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
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,8 +14,10 @@ describe Issues::CloseService do
describe :execute do
context "valid params" do
before do
perform_enqueued_jobs do
@issue = Issues::CloseService.new(project, user, {}).execute(issue)
end
end
it { expect(@issue).to be_valid }
it { expect(@issue).to be_closed }
......
......@@ -36,7 +36,10 @@ describe Issues::UpdateService do
label_ids: [label.id]
}
perform_enqueued_jobs do
@issue = Issues::UpdateService.new(project, user, opts).execute(issue)
end
@issue.reload
end
......
......@@ -18,8 +18,10 @@ describe MergeRequests::CloseService do
before do
allow(service).to receive(:execute_hooks)
perform_enqueued_jobs do
@merge_request = service.execute(merge_request)
end
end
it { expect(@merge_request).to be_valid }
it { expect(@merge_request).to be_closed }
......
......@@ -17,9 +17,10 @@ describe MergeRequests::MergeService do
before do
allow(service).to receive(:execute_hooks)
perform_enqueued_jobs do
service.execute(merge_request, 'Awesome message')
end
end
it { expect(merge_request).to be_valid }
it { expect(merge_request).to be_merged }
......
......@@ -19,8 +19,10 @@ describe MergeRequests::ReopenService do
allow(service).to receive(:execute_hooks)
merge_request.state = :closed
perform_enqueued_jobs do
service.execute(merge_request)
end
end
it { expect(merge_request).to be_valid }
it { expect(merge_request).to be_reopened }
......
......@@ -42,9 +42,11 @@ describe MergeRequests::UpdateService do
before do
allow(service).to receive(:execute_hooks)
perform_enqueued_jobs do
@merge_request = service.execute(merge_request)
@merge_request.reload
end
end
it { expect(@merge_request).to be_valid }
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