diff options
author | ThibG <thib@sitedethib.com> | 2019-11-21 10:01:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-21 10:01:26 +0100 |
commit | 55f5e81a9dc4c6cede5d43e549061be2ea9be614 (patch) | |
tree | 6b8944b2bf8e13ba76627a0e38886dfb3b35c566 /spec/controllers | |
parent | 707c4918b21d19dd53b64120dbc7263f45fc5ecd (diff) | |
parent | e87cc59811fab285033cc78d97ad7f0b8df9c081 (diff) |
Merge pull request #1246 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/api/v1/accounts/credentials_controller_spec.rb | 13 | ||||
-rw-r--r-- | spec/controllers/api/v1/bookmarks_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/application_controller_spec.rb | 5 |
3 files changed, 14 insertions, 6 deletions
diff --git a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb index e9466e4ed..4fa6fbcf4 100644 --- a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb @@ -59,6 +59,19 @@ describe Api::V1::Accounts::CredentialsController do end end + describe 'with empty source list' do + before do + patch :update, params: { + display_name: "I'm a cat", + source: {}, + }, as: :json + end + + it 'returns http success' do + expect(response).to have_http_status(200) + end + end + describe 'with invalid data' do before do note = 'This is too long. ' diff --git a/spec/controllers/api/v1/bookmarks_controller_spec.rb b/spec/controllers/api/v1/bookmarks_controller_spec.rb index 79601b6e6..d7c5847b0 100644 --- a/spec/controllers/api/v1/bookmarks_controller_spec.rb +++ b/spec/controllers/api/v1/bookmarks_controller_spec.rb @@ -64,7 +64,7 @@ RSpec.describe Api::V1::BookmarksController, type: :controller do get :index, params: { limit: 1 } expect(response.headers['Link'].find_link(['rel', 'next']).href).to eq "http://test.host/api/v1/bookmarks?limit=1&max_id=#{bookmark.id}" - expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq "http://test.host/api/v1/bookmarks?limit=1&since_id=#{bookmark.id}" + expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq "http://test.host/api/v1/bookmarks?limit=1&min_id=#{bookmark.id}" end it 'does not add pagination headers if not necessary' do diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 4ac69b719..686ae70fb 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -22,11 +22,6 @@ describe ApplicationController, type: :controller do end shared_examples 'respond_with_error' do |code| - it "returns http #{code} for any" do - subject - expect(response).to have_http_status(code) - end - it "returns http #{code} for http" do subject expect(response).to have_http_status(code) |