Skip to content

Commit

Permalink
Adapt test to 4.0, 4.1 and 4.2 rails versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Mendo committed Sep 11, 2015
1 parent 22a9599 commit 74aabbd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion spec/models/nocms/pages/page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
let(:page) { create :nocms_page}
let(:duplicated_page) { build :nocms_page, slug: page.slug}

before { duplicated_page.valid? }

subject { duplicated_page }

it("should not have a valid path") { expect(subject.errors_on(:path)).to_not be_blank }
it("should not have a valid path") { expect(subject.errors[:path]).to_not be_blank }

end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
config.include FactoryGirl::Syntax::Methods

# Capybara DSL only in request specs
config.include Capybara::DSL, :type => :request
config.include Capybara::DSL

# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
Expand Down
2 changes: 1 addition & 1 deletion spec/support/concerns/model_with_required_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
subject { model_object }

it { should_not be_valid }
it { expect(subject.error_on(attribute_name)).to include I18n.t('errors.messages.blank') }
it { expect(subject.errors[attribute_name]).to include I18n.t('errors.messages.blank') }
end

end
Expand Down

0 comments on commit 74aabbd

Please sign in to comment.