BigW Consortium Gitlab

Commit af692628 by Stan Hu

Fix Bitbucket status controller spec

parent 7ba65d05
...@@ -47,14 +47,13 @@ describe Import::BitbucketController do ...@@ -47,14 +47,13 @@ describe Import::BitbucketController do
describe "GET status" do describe "GET status" do
before 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 assign_session_tokens
end end
it "assigns variables" do it "assigns variables" do
@project = create(:project, import_type: 'bitbucket', creator_id: user.id) @project = create(:project, import_type: 'bitbucket', creator_id: user.id)
client = stub_client(projects: [@repo]) allow_any_instance_of(Bitbucket::Client).to receive(:repos).and_return([@repo])
allow(client).to receive(:incompatible_projects).and_return([])
get :status get :status
...@@ -65,7 +64,7 @@ describe Import::BitbucketController do ...@@ -65,7 +64,7 @@ describe Import::BitbucketController do
it "does not show already added project" do it "does not show already added project" do
@project = create(:project, import_type: 'bitbucket', creator_id: user.id, import_source: 'asd/vim') @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 get :status
......
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