Commit f1504e1a authored by Valery Sizov's avatar Valery Sizov

test fix

parent e92ceb7b
...@@ -55,7 +55,7 @@ class GitlabCiService < CiService ...@@ -55,7 +55,7 @@ class GitlabCiService < CiService
end end
def get_ci_commit(sha, ref) def get_ci_commit(sha, ref)
Ci::Project.find(project.gitlab_ci_project).commits.find_by_sha!(sha) Ci::Project.find(project.gitlab_ci_project.id).commits.find_by_sha!(sha)
end end
def commit_status(sha, ref) def commit_status(sha, ref)
......
...@@ -93,7 +93,10 @@ describe "Admin::Users", feature: true do ...@@ -93,7 +93,10 @@ describe "Admin::Users", feature: true do
end end
it "should send valid email to user with email & password" do it "should send valid email to user with email & password" do
perform_enqueued_jobs do
click_button "Create user" click_button "Create user"
end
user = User.find_by(username: 'bang') user = User.find_by(username: 'bang')
email = ActionMailer::Base.deliveries.last email = ActionMailer::Base.deliveries.last
expect(email.subject).to have_content('Account was created') expect(email.subject).to have_content('Account was created')
......
...@@ -14,8 +14,10 @@ describe Issues::CloseService do ...@@ -14,8 +14,10 @@ describe Issues::CloseService do
describe :execute do describe :execute do
context "valid params" do context "valid params" do
before do before do
perform_enqueued_jobs do
@issue = Issues::CloseService.new(project, user, {}).execute(issue) @issue = Issues::CloseService.new(project, user, {}).execute(issue)
end end
end
it { expect(@issue).to be_valid } it { expect(@issue).to be_valid }
it { expect(@issue).to be_closed } it { expect(@issue).to be_closed }
......
...@@ -36,7 +36,10 @@ describe Issues::UpdateService do ...@@ -36,7 +36,10 @@ describe Issues::UpdateService do
label_ids: [label.id] label_ids: [label.id]
} }
perform_enqueued_jobs do
@issue = Issues::UpdateService.new(project, user, opts).execute(issue) @issue = Issues::UpdateService.new(project, user, opts).execute(issue)
end
@issue.reload @issue.reload
end end
......
...@@ -18,8 +18,10 @@ describe MergeRequests::CloseService do ...@@ -18,8 +18,10 @@ describe MergeRequests::CloseService do
before do before do
allow(service).to receive(:execute_hooks) allow(service).to receive(:execute_hooks)
perform_enqueued_jobs do
@merge_request = service.execute(merge_request) @merge_request = service.execute(merge_request)
end end
end
it { expect(@merge_request).to be_valid } it { expect(@merge_request).to be_valid }
it { expect(@merge_request).to be_closed } it { expect(@merge_request).to be_closed }
......
...@@ -17,9 +17,10 @@ describe MergeRequests::MergeService do ...@@ -17,9 +17,10 @@ describe MergeRequests::MergeService do
before do before do
allow(service).to receive(:execute_hooks) allow(service).to receive(:execute_hooks)
perform_enqueued_jobs do
service.execute(merge_request, 'Awesome message') service.execute(merge_request, 'Awesome message')
end end
end
it { expect(merge_request).to be_valid } it { expect(merge_request).to be_valid }
it { expect(merge_request).to be_merged } it { expect(merge_request).to be_merged }
......
...@@ -19,8 +19,10 @@ describe MergeRequests::ReopenService do ...@@ -19,8 +19,10 @@ describe MergeRequests::ReopenService do
allow(service).to receive(:execute_hooks) allow(service).to receive(:execute_hooks)
merge_request.state = :closed merge_request.state = :closed
perform_enqueued_jobs do
service.execute(merge_request) service.execute(merge_request)
end end
end
it { expect(merge_request).to be_valid } it { expect(merge_request).to be_valid }
it { expect(merge_request).to be_reopened } it { expect(merge_request).to be_reopened }
......
...@@ -42,9 +42,11 @@ describe MergeRequests::UpdateService do ...@@ -42,9 +42,11 @@ describe MergeRequests::UpdateService do
before do before do
allow(service).to receive(:execute_hooks) allow(service).to receive(:execute_hooks)
perform_enqueued_jobs do
@merge_request = service.execute(merge_request) @merge_request = service.execute(merge_request)
@merge_request.reload @merge_request.reload
end end
end
it { expect(@merge_request).to be_valid } it { expect(@merge_request).to be_valid }
it { expect(@merge_request.title).to eq('New title') } it { expect(@merge_request.title).to eq('New title') }
......
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