diff options
author | James Lopez <james@jameslopez.es> | 2016-04-28 11:26:44 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-04-28 11:26:44 +0300 |
commit | 8793025dd04b7a6c8dd6dd04a52eabbfc612745d (patch) | |
tree | adc3e0d43d057998579c78a293d63c41f1fa6fe7 /spec/lib | |
parent | ce9310d63f6ddf55187d16b882d59f26f7b384a9 (diff) |
added spec testing exception raised
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/bitbucket_import/client_spec.rb | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/spec/lib/gitlab/bitbucket_import/client_spec.rb b/spec/lib/gitlab/bitbucket_import/client_spec.rb index aa0699f2ebf..cd31894eda6 100644 --- a/spec/lib/gitlab/bitbucket_import/client_spec.rb +++ b/spec/lib/gitlab/bitbucket_import/client_spec.rb @@ -34,18 +34,33 @@ describe Gitlab::BitbucketImport::Client, lib: true do it 'retrieves issues over a number of pages' do stub_request(:get, "https://bitbucket.org/api/1.0/repositories/#{project_id}/issues?limit=50&sort=utc_created_on&start=0"). - to_return(status: 200, - body: first_sample_data.to_json, - headers: {}) + to_return(status: 200, + body: first_sample_data.to_json, + headers: {}) stub_request(:get, "https://bitbucket.org/api/1.0/repositories/#{project_id}/issues?limit=50&sort=utc_created_on&start=50"). - to_return(status: 200, - body: second_sample_data.to_json, - headers: {}) + to_return(status: 200, + body: second_sample_data.to_json, + headers: {}) issues = client.issues(project_id) expect(issues.count).to eq(95) end end + + context 'project import' do + it 'calls .from_project with no errors' do + project = create(:empty_project) + project.create_or_update_import_data(credentials: + { :user => "git", + :password => nil, + :bb_session => + { :bitbucket_access_token => "test", + :bitbucket_access_token_secret => "test" } }) + project.import_url = "ssh://git@bitbucket.org/test/test.git" + + expect { described_class.from_project(project) }.to_not raise_error + end + end end |