Enable RSpec/NotToNot cop and fix all issues

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
This commit is contained in:
Bertocq
2018-01-07 17:39:48 +01:00
parent 79a3b97c64
commit 34bb9d65b1
143 changed files with 1041 additions and 1038 deletions

View File

@@ -51,7 +51,7 @@ feature 'Commenting debates' do
find("#comment_#{child_comment.id}_children_arrow").trigger('click')
expect(page).to have_css('.comment', count: 2)
expect(page).to_not have_content grandchild_comment.body
expect(page).not_to have_content grandchild_comment.body
find("#comment_#{child_comment.id}_children_arrow").trigger('click')
@@ -61,8 +61,8 @@ feature 'Commenting debates' do
find("#comment_#{parent_comment.id}_children_arrow").trigger('click')
expect(page).to have_css('.comment', count: 1)
expect(page).to_not have_content child_comment.body
expect(page).to_not have_content grandchild_comment.body
expect(page).not_to have_content child_comment.body
expect(page).not_to have_content grandchild_comment.body
end
scenario 'Comment order' do
@@ -147,7 +147,7 @@ feature 'Commenting debates' do
within("ul.pagination") do
expect(page).to have_content("1")
expect(page).to have_content("2")
expect(page).to_not have_content("3")
expect(page).not_to have_content("3")
click_link "Next", exact: false
end
@@ -161,8 +161,8 @@ feature 'Commenting debates' do
expect(page).to have_content 'You must Sign in or Sign up to leave a comment'
within('#comments') do
expect(page).to_not have_content 'Write a comment'
expect(page).to_not have_content 'Reply'
expect(page).not_to have_content 'Write a comment'
expect(page).not_to have_content 'Reply'
end
end
end
@@ -208,7 +208,7 @@ feature 'Commenting debates' do
expect(page).to have_content 'It will be done next week.'
end
expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
end
scenario 'Errors on reply', :js do
@@ -268,7 +268,7 @@ feature 'Commenting debates' do
expect(page).to have_css("#flag-expand-comment-#{comment.id}")
end
expect(Flag.flagged?(user, comment)).to_not be
expect(Flag.flagged?(user, comment)).not_to be
end
scenario "Flagging turbolinks sanity check", :js do
@@ -307,7 +307,7 @@ feature 'Commenting debates' do
# The button's text should now be "..."
# This should be checked before the Ajax request is finished
expect(page).to_not have_button 'Publish comment'
expect(page).not_to have_button 'Publish comment'
expect(page).to have_content('Testing submit button!')
end
@@ -355,7 +355,7 @@ feature 'Commenting debates' do
expect(page).to have_css "img.moderator-avatar"
end
expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
end
scenario "can not comment as an administrator" do
@@ -364,7 +364,7 @@ feature 'Commenting debates' do
login_as(moderator.user)
visit debate_path(debate)
expect(page).to_not have_content "Comment as administrator"
expect(page).not_to have_content "Comment as administrator"
end
end
@@ -411,7 +411,7 @@ feature 'Commenting debates' do
expect(page).to have_css "img.admin-avatar"
end
expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
end
scenario "can not comment as a moderator" do
@@ -420,7 +420,7 @@ feature 'Commenting debates' do
login_as(admin.user)
visit debate_path(debate)
expect(page).to_not have_content "Comment as moderator"
expect(page).not_to have_content "Comment as moderator"
end
end
@@ -501,7 +501,7 @@ feature 'Commenting debates' do
find('.in_favor a').click
within('.in_favor') do
expect(page).to_not have_content "2"
expect(page).not_to have_content "2"
expect(page).to have_content "1"
end