Commit bf71d53f authored by Robert Speicher's avatar Robert Speicher Committed by Dmitriy Zaporozhets

Change `to_not` calls to `not_to`

Both work, but now we're consistent across the entire app.
parent 0f627f1c
......@@ -40,10 +40,10 @@ describe Projects::CommitController do
get(:show, namespace_id: project.namespace.to_param,
project_id: project.to_param, id: commit.id, format: format)
expect(response.body).to_not include('&')
expect(response.body).to_not include('>')
expect(response.body).to_not include('<')
expect(response.body).to_not include('"')
expect(response.body).not_to include('&')
expect(response.body).not_to include('>')
expect(response.body).not_to include('<')
expect(response.body).not_to include('"')
end
end
......
......@@ -40,10 +40,10 @@ describe Projects::MergeRequestsController do
get(:show, namespace_id: project.namespace.to_param,
project_id: project.to_param, id: merge_request.iid, format: format)
expect(response.body).to_not include('&')
expect(response.body).to_not include('>')
expect(response.body).to_not include('<')
expect(response.body).to_not include('"')
expect(response.body).not_to include('&')
expect(response.body).not_to include('>')
expect(response.body).not_to include('<')
expect(response.body).not_to include('"')
end
end
......
......@@ -38,7 +38,7 @@ describe 'Issues', feature: true do
it 'does not change issue count' do
expect {
click_button 'Save changes'
}.to_not change { Issue.count }
}.not_to change { Issue.count }
end
it 'should update issue fields' do
......
......@@ -27,12 +27,12 @@ describe Gitlab::Auth do
it "should not find user with invalid password" do
password = 'wrong'
expect( gl_auth.find(username, password) ).to_not eql user
expect( gl_auth.find(username, password) ).not_to eql user
end
it "should not find user with invalid login" do
user = 'wrong'
expect( gl_auth.find(username, password) ).to_not eql user
expect( gl_auth.find(username, password) ).not_to eql user
end
context "with ldap enabled" do
......
......@@ -15,7 +15,7 @@ describe Gitlab::GoogleCodeImport::Client do
let(:raw_data) { "No clue" }
it "returns true" do
expect(subject).to_not be_valid
expect(subject).not_to be_valid
end
end
end
......
......@@ -25,7 +25,7 @@ describe Gitlab::GoogleCodeImport::Importer do
subject.execute
%w(New NeedInfo Accepted Wishlist Started Fixed Invalid Duplicate WontFix Incomplete).each do |status|
expect(project.labels.find_by(name: "Status: #{status}")).to_not be_nil
expect(project.labels.find_by(name: "Status: #{status}")).not_to be_nil
end
end
......@@ -39,7 +39,7 @@ describe Gitlab::GoogleCodeImport::Importer do
Component-Systray Component-Clock Component-Launcher Component-Tint2conf Component-Docs Component-New
).each do |label|
label.sub!("-", ": ")
expect(project.labels.find_by(name: label)).to_not be_nil
expect(project.labels.find_by(name: label)).not_to be_nil
end
end
......@@ -47,7 +47,7 @@ describe Gitlab::GoogleCodeImport::Importer do
subject.execute
issue = project.issues.first
expect(issue).to_not be_nil
expect(issue).not_to be_nil
expect(issue.iid).to eq(169)
expect(issue.author).to eq(project.creator)
expect(issue.assignee).to eq(mapped_user)
......@@ -72,7 +72,7 @@ describe Gitlab::GoogleCodeImport::Importer do
subject.execute
note = project.issues.first.notes.first
expect(note).to_not be_nil
expect(note).not_to be_nil
expect(note.note).to include("Comment 1")
expect(note.note).to include("@#{mapped_user.username}")
expect(note.note).to include("November 18, 2009 05:14")
......
......@@ -35,12 +35,12 @@ describe Gitlab::LDAP::User do
it "finds the user if already existing" do
create(:omniauth_user, extern_uid: 'my-uid', provider: 'ldapmain')
expect{ ldap_user.save }.to_not change{ User.count }
expect{ ldap_user.save }.not_to change{ User.count }
end
it "connects to existing non-ldap user if the email matches" do
existing_user = create(:omniauth_user, email: 'john@example.com', provider: "twitter")
expect{ ldap_user.save }.to_not change{ User.count }
expect{ ldap_user.save }.not_to change{ User.count }
existing_user.reload
expect(existing_user.ldap_identity.extern_uid).to eql 'my-uid'
......
......@@ -51,7 +51,7 @@ describe Gitlab::OAuth::AuthHash do
it { expect(auth_hash.email).to eql email_utf8 }
it { expect(auth_hash.username).to eql nickname_utf8 }
it { expect(auth_hash.name).to eql name_utf8 }
it { expect(auth_hash.password).to_not be_empty }
it { expect(auth_hash.password).not_to be_empty }
end
context 'email not provided' do
......
......@@ -132,7 +132,7 @@ describe API::API, api: true do
delete api("/projects/#{project.id}/members/#{user3.id}", user)
expect {
delete api("/projects/#{project.id}/members/#{user3.id}", user)
}.to_not change { ProjectMember.count }
}.not_to change { ProjectMember.count }
end
it "should return 200 if team member already removed" do
......
......@@ -155,7 +155,7 @@ describe API::API, api: true do
end
it 'should not create new project without name and return 400' do
expect { post api('/projects', user) }.to_not change { Project.count }
expect { post api('/projects', user) }.not_to change { Project.count }
expect(response.status).to eq(400)
end
......@@ -254,7 +254,7 @@ describe API::API, api: true do
it 'should respond with 400 on failure and not project' do
expect { post api("/projects/user/#{user.id}", admin) }.
to_not change { Project.count }
not_to change { Project.count }
expect(response.status).to eq(400)
expect(json_response['message']['name']).to eq([
......
......@@ -49,7 +49,7 @@ describe API::API, api: true do
it "should not create new hook without url" do
expect {
post api("/hooks", admin)
}.to_not change { SystemHook.count }
}.not_to change { SystemHook.count }
end
end
......
......@@ -150,7 +150,7 @@ describe 'gitlab:app namespace rake task' do
expect(Rake::Task["gitlab:backup:db:restore"]).to receive :invoke
expect(Rake::Task["gitlab:backup:repo:restore"]).not_to receive :invoke
expect(Rake::Task["gitlab:shell:setup"]).to receive :invoke
expect { run_rake_task('gitlab:backup:restore') }.to_not raise_error
expect { run_rake_task('gitlab:backup:restore') }.not_to raise_error
end
end
end # gitlab:app namespace
......@@ -21,7 +21,7 @@ describe 'gitlab:mail_google_schema_whitelisting rake task' do
end
it 'should run the task without errors' do
expect { run_rake_task }.to_not raise_error
expect { run_rake_task }.not_to raise_error
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment