diff options
author | Stan Hu <stanhu@gmail.com> | 2016-11-20 21:33:06 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-11-21 16:47:30 -0800 |
commit | af6926283b8c4d8cd9668a8df6a28f2ce35001f6 (patch) | |
tree | 1bc888b3353bc23c37f619b59d4966f5d8f85b22 /spec/controllers/import/bitbucket_controller_spec.rb | |
parent | 7ba65d05af190a0aba05bd78463eb9e7d70ca6f7 (diff) | |
download | gitlab-ce-af6926283b8c4d8cd9668a8df6a28f2ce35001f6.tar.gz |
Fix Bitbucket status controller spec
Diffstat (limited to 'spec/controllers/import/bitbucket_controller_spec.rb')
-rw-r--r-- | spec/controllers/import/bitbucket_controller_spec.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/controllers/import/bitbucket_controller_spec.rb b/spec/controllers/import/bitbucket_controller_spec.rb index 11bb190af7e..2fd01c865fb 100644 --- a/spec/controllers/import/bitbucket_controller_spec.rb +++ b/spec/controllers/import/bitbucket_controller_spec.rb @@ -47,14 +47,13 @@ describe Import::BitbucketController do describe "GET status" do before do - @repo = OpenStruct.new(slug: 'vim', owner: 'asd') + @repo = double(slug: 'vim', owner: 'asd', full_name: 'asd/vim', "valid?" => true) assign_session_tokens end it "assigns variables" do @project = create(:project, import_type: 'bitbucket', creator_id: user.id) - client = stub_client(projects: [@repo]) - allow(client).to receive(:incompatible_projects).and_return([]) + allow_any_instance_of(Bitbucket::Client).to receive(:repos).and_return([@repo]) get :status @@ -65,7 +64,7 @@ describe Import::BitbucketController do it "does not show already added project" do @project = create(:project, import_type: 'bitbucket', creator_id: user.id, import_source: 'asd/vim') - stub_client(projects: [@repo]) + allow_any_instance_of(Bitbucket::Client).to receive(:repos).and_return([@repo]) get :status |