Enable RSpec/MessageExpectation cop & fix issues

There was 34 `allow` occurences and 17 `expect` occurences, so to be consistent `allow` form was chosen.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
This commit is contained in:
Bertocq
2018-01-07 16:31:01 +01:00
parent 987b31d618
commit c4aa2d7093
9 changed files with 22 additions and 19 deletions

View File

@@ -34,7 +34,7 @@ feature 'Localization' do
end
scenario 'Locale switcher not present if only one locale' do
expect(I18n).to receive(:available_locales).and_return([:en])
allow(I18n).to receive(:available_locales).and_return([:en])
visit '/'
expect(page).to_not have_content('Language')

View File

@@ -39,10 +39,10 @@ feature 'Localization' do
end
scenario 'Locale switcher not present if only one locale' do
expect(I18n).to receive(:available_locales).and_return([:en])
allow(I18n).to receive(:available_locales).and_return([:en])
visit management_root_path
expect(page).to_not have_content('Language')
expect(page).to_not have_css('div.locale')
end
end
end