Skip to content

Commit

Permalink
Fix RSpec issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbrodie committed Apr 29, 2024
1 parent 6cec323 commit 3f25297
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions spec/integration/issue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@
stub_request(:get, "#{site_url}/jira/rest/api/2/search?expand=transitions.fields&maxResults=1000&startAt=11")
.to_return(status: 200, body: get_mock_response('empty_issues.json'))
end

it_behaves_like 'a resource with a collection GET endpoint'
end

it_behaves_like 'a resource with a DELETE endpoint'
it_behaves_like 'a resource with a POST endpoint'
it_behaves_like 'a resource with a PUT endpoint'
Expand Down
1 change: 1 addition & 0 deletions spec/integration/rapidview_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
stub_request(:get, "#{site_url}/jira/rest/greenhopper/1.0/rapidview")
.to_return(status: 200, body: get_mock_response('rapidview.json'))
end

it_behaves_like 'a resource with a collection GET endpoint'
end

Expand Down
1 change: 1 addition & 0 deletions spec/jira/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class JIRA::Resource::HasManyExample < JIRA::Base # :nodoc:
it 'responds to client' do
expect(decorated.respond_to?(:client)).to eq(true)
end

it 'does not raise an error' do
expect do
decorated.respond_to?(:client)
Expand Down
2 changes: 1 addition & 1 deletion spec/jira/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
expect(subject).to receive(:merge_default_headers).exactly(3).times.with({})

# response for merging headers for http methods with body
expect(subject).to receive(:merge_default_headers).exactly(2).times.with(content_type_header)
expect(subject).to receive(:merge_default_headers).twice.with(content_type_header)

%i[delete get head].each { |method| subject.send(method, '/path', {}) }
%i[post put].each { |method| subject.send(method, '/path', '', content_type_header) }
Expand Down
1 change: 1 addition & 0 deletions spec/jira/resource/attachment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
expect(attachment.mimeType).to eq file_mime_type
expect(attachment.size).to eq file_size
end

context 'when using custom client headers' do
subject(:bearer_attachment) do
described_class.new(
Expand Down
2 changes: 1 addition & 1 deletion spec/jira/resource/board_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,6 @@ class JIRAResourceDelegation < SimpleDelegator # :nodoc:
allow(board).to receive(:id).and_return(84)
expect(client).to receive(:get).with('/rest/agile/1.0/board/84/configuration').and_return(response)
expect(client).to receive(:BoardConfiguration).and_return(JIRA::Resource::BoardConfigurationFactory.new(client))
expect(board.configuration).not_to be(nil)
expect(board.configuration).not_to be_nil
end
end
2 changes: 2 additions & 0 deletions spec/jira/resource/issue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ class JIRAResourceDelegation < SimpleDelegator # :nodoc:
issue = described_class.find(client, 101)
@decorated = JIRAResourceDelegation.new(issue)
end

it 'responds to key' do
expect(@decorated.respond_to?(:key)).to eq(true)
end

it 'does not raise an error' do
expect do
@issue.respond_to?(:project)
Expand Down

0 comments on commit 3f25297

Please sign in to comment.