Commit f1504e1a authored by Valery Sizov's avatar Valery Sizov

test fix

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