diff options
Diffstat (limited to 'spec/lib/bitbucket')
5 files changed, 11 insertions, 8 deletions
diff --git a/spec/lib/bitbucket/connection_spec.rb b/spec/lib/bitbucket/connection_spec.rb index 6be681a8b47..14faeb231a9 100644 --- a/spec/lib/bitbucket/connection_spec.rb +++ b/spec/lib/bitbucket/connection_spec.rb @@ -1,6 +1,10 @@ require 'spec_helper' describe Bitbucket::Connection do + before do + allow_any_instance_of(described_class).to receive(:provider).and_return(double(app_id: '', app_secret: '')) + end + describe '#get' do it 'calls OAuth2::AccessToken::get' do expect_any_instance_of(OAuth2::AccessToken).to receive(:get).and_return(double(parsed: true)) diff --git a/spec/lib/bitbucket/representation/comment_spec.rb b/spec/lib/bitbucket/representation/comment_spec.rb index 5864193cbfc..fec243a9f96 100644 --- a/spec/lib/bitbucket/representation/comment_spec.rb +++ b/spec/lib/bitbucket/representation/comment_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Bitbucket::Representation::Comment do describe '#author' do it { expect(described_class.new('user' => { 'username' => 'Ben' }).author).to eq('Ben') } - it { expect(described_class.new({}).author).to eq('Anonymous') } + it { expect(described_class.new({}).author).to be_nil } end describe '#note' do diff --git a/spec/lib/bitbucket/representation/issue_spec.rb b/spec/lib/bitbucket/representation/issue_spec.rb index 56deae63bbc..e1f3419c77e 100644 --- a/spec/lib/bitbucket/representation/issue_spec.rb +++ b/spec/lib/bitbucket/representation/issue_spec.rb @@ -10,12 +10,12 @@ describe Bitbucket::Representation::Issue do end describe '#author' do - it { expect(described_class.new({ 'reporter' => { 'username' => 'Ben' }}).author).to eq('Ben') } - it { expect(described_class.new({}).author).to eq('Anonymous') } + it { expect(described_class.new({ 'reporter' => { 'username' => 'Ben' } }).author).to eq('Ben') } + it { expect(described_class.new({}).author).to be_nil } end describe '#description' do - it { expect(described_class.new({ 'content' => { 'raw' => 'Text' }}).description).to eq('Text') } + it { expect(described_class.new({ 'content' => { 'raw' => 'Text' } }).description).to eq('Text') } it { expect(described_class.new({}).description).to be_nil } end diff --git a/spec/lib/bitbucket/representation/pull_request_comment_spec.rb b/spec/lib/bitbucket/representation/pull_request_comment_spec.rb index 8377f0540cd..673dcf22ce8 100644 --- a/spec/lib/bitbucket/representation/pull_request_comment_spec.rb +++ b/spec/lib/bitbucket/representation/pull_request_comment_spec.rb @@ -17,9 +17,8 @@ describe Bitbucket::Representation::PullRequestComment do it { expect(described_class.new('inline' => { 'to' => 3 }).new_pos).to eq(3) } end - describe '#parent_id' do - it { expect(described_class.new({ 'parent' => { 'id' => 2 }}).parent_id).to eq(2) } + it { expect(described_class.new({ 'parent' => { 'id' => 2 } }).parent_id).to eq(2) } it { expect(described_class.new({}).parent_id).to be_nil } end diff --git a/spec/lib/bitbucket/representation/pull_request_spec.rb b/spec/lib/bitbucket/representation/pull_request_spec.rb index 661422efddf..30453528be4 100644 --- a/spec/lib/bitbucket/representation/pull_request_spec.rb +++ b/spec/lib/bitbucket/representation/pull_request_spec.rb @@ -6,8 +6,8 @@ describe Bitbucket::Representation::PullRequest do end describe '#author' do - it { expect(described_class.new({ 'author' => { 'username' => 'Ben' }}).author).to eq('Ben') } - it { expect(described_class.new({}).author).to eq('Anonymous') } + it { expect(described_class.new({ 'author' => { 'username' => 'Ben' } }).author).to eq('Ben') } + it { expect(described_class.new({}).author).to be_nil } end describe '#description' do |