Skip to content

Commit

Permalink
Prepare RSpec and rubocop.yml for merge of v1.5.2 (#1071)
Browse files Browse the repository at this point in the history
* add ContentType for POST requests in server-tag related RSpec

* increase rubocop PerceivedComplexity limit 20

* Update .rubocop.yml

---------

Co-authored-by: Ahmad Farhat <[email protected]>
Co-authored-by: Ahmad Farhat <[email protected]>
  • Loading branch information
3 people authored Jun 27, 2024
1 parent 538df51 commit bd501cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Metrics/BlockLength:

# A complexity metric geared towards measuring complexity for a human reader.
Metrics/PerceivedComplexity:
Max: 17
Max: 21
Exclude:
- app/models/recording.rb
- app/models/server.rb
Expand Down
6 changes: 3 additions & 3 deletions spec/requests/servers_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
context 'when updating tag' do
it 'updates the server tag' do
server = create(:server)
post scalelite_api_update_server_url, params: { id: server.id, server: { tag: 'test-tag' } }
post scalelite_api_update_server_url, params: { id: server.id, server: { tag: 'test-tag' } }, as: :json
updated_server = Server.find(server.id) # Reload
expect(updated_server.tag).to eq("test-tag")
expect(response).to have_http_status(:ok)
Expand All @@ -159,10 +159,10 @@

it 'updates the server tag back to nil' do
server = create(:server)
post scalelite_api_update_server_url, params: { id: server.id, server: { tag: 'test-tag' } }
post scalelite_api_update_server_url, params: { id: server.id, server: { tag: 'test-tag' } }, as: :json
updated_server = Server.find(server.id) # Reload
expect(updated_server.tag).to eq("test-tag")
post scalelite_api_update_server_url, params: { id: server.id, server: { tag: '' } }
post scalelite_api_update_server_url, params: { id: server.id, server: { tag: '' } }, as: :json
updated_server = Server.find(server.id) # Reload
expect(updated_server.tag).to be_nil
expect(response).to have_http_status(:ok)
Expand Down

0 comments on commit bd501cd

Please sign in to comment.