diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-07-27 12:33:50 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-07-29 15:20:39 +0530 |
commit | c93a895abc434b9b78aa7cf4d285ce309cfd868a (patch) | |
tree | c6b8ef773c61843da4515aaa4683a466a67c223a /spec | |
parent | 6d841eaadcbccfa4527bd892bf86fc8dbba19455 (diff) | |
download | gitlab-ce-c93a895abc434b9b78aa7cf4d285ce309cfd868a.tar.gz |
Fix `git_push_service_spec`
1. Caused by incorrect test setup. The user wasn't added to the project,
so protected branch creation failed authorization.
2. Change setup for a different test (`Event.last` to
`Event.find_by_action`) because our `project.team << ...` addition
was causing a conflict.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/git_push_service_spec.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb index 663c270d61f..621eced83f6 100644 --- a/spec/services/git_push_service_spec.rb +++ b/spec/services/git_push_service_spec.rb @@ -7,6 +7,7 @@ describe GitPushService, services: true do let(:project) { create :project } before do + project.team << [user, :master] @blankrev = Gitlab::Git::BLANK_SHA @oldrev = sample_commit.parent_id @newrev = sample_commit.id @@ -172,7 +173,7 @@ describe GitPushService, services: true do describe "Push Event" do before do service = execute_service(project, user, @oldrev, @newrev, @ref ) - @event = Event.last + @event = Event.find_by_action(Event::PUSHED) @push_data = service.push_data end |