Audofix Rubocop Style/WordArray (#23739)
This commit is contained in:
parent
4552685f6b
commit
bf785df9fe
17 changed files with 27 additions and 50 deletions
|
@ -37,13 +37,13 @@ RSpec.describe Api::V1::BlocksController, type: :controller do
|
|||
it 'sets pagination header for next path' do
|
||||
blocks = 2.times.map { Fabricate(:block, account: user.account) }
|
||||
get :index, params: { limit: 1, since_id: blocks[0] }
|
||||
expect(response.headers['Link'].find_link(['rel', 'next']).href).to eq api_v1_blocks_url(limit: 1, max_id: blocks[1])
|
||||
expect(response.headers['Link'].find_link(%w(rel next)).href).to eq api_v1_blocks_url(limit: 1, max_id: blocks[1])
|
||||
end
|
||||
|
||||
it 'sets pagination header for previous path' do
|
||||
block = Fabricate(:block, account: user.account)
|
||||
get :index
|
||||
expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq api_v1_blocks_url(since_id: block)
|
||||
expect(response.headers['Link'].find_link(%w(rel prev)).href).to eq api_v1_blocks_url(since_id: block)
|
||||
end
|
||||
|
||||
it 'returns http success' do
|
||||
|
|
|
@ -63,8 +63,8 @@ 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&min_id=#{bookmark.id}"
|
||||
expect(response.headers['Link'].find_link(%w(rel next)).href).to eq "http://test.host/api/v1/bookmarks?limit=1&max_id=#{bookmark.id}"
|
||||
expect(response.headers['Link'].find_link(%w(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
|
||||
|
|
|
@ -63,8 +63,8 @@ RSpec.describe Api::V1::FavouritesController, type: :controller do
|
|||
|
||||
get :index, params: { limit: 1 }
|
||||
|
||||
expect(response.headers['Link'].find_link(['rel', 'next']).href).to eq "http://test.host/api/v1/favourites?limit=1&max_id=#{favourite.id}"
|
||||
expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq "http://test.host/api/v1/favourites?limit=1&min_id=#{favourite.id}"
|
||||
expect(response.headers['Link'].find_link(%w(rel next)).href).to eq "http://test.host/api/v1/favourites?limit=1&max_id=#{favourite.id}"
|
||||
expect(response.headers['Link'].find_link(%w(rel prev)).href).to eq "http://test.host/api/v1/favourites?limit=1&min_id=#{favourite.id}"
|
||||
end
|
||||
|
||||
it 'does not add pagination headers if not necessary' do
|
||||
|
|
|
@ -37,13 +37,13 @@ RSpec.describe Api::V1::MutesController, type: :controller do
|
|||
it 'sets pagination header for next path' do
|
||||
mutes = 2.times.map { Fabricate(:mute, account: user.account) }
|
||||
get :index, params: { limit: 1, since_id: mutes[0] }
|
||||
expect(response.headers['Link'].find_link(['rel', 'next']).href).to eq api_v1_mutes_url(limit: 1, max_id: mutes[1])
|
||||
expect(response.headers['Link'].find_link(%w(rel next)).href).to eq api_v1_mutes_url(limit: 1, max_id: mutes[1])
|
||||
end
|
||||
|
||||
it 'sets pagination header for previous path' do
|
||||
mute = Fabricate(:mute, account: user.account)
|
||||
get :index
|
||||
expect(response.headers['Link'].find_link(['rel', 'prev']).href).to eq api_v1_mutes_url(since_id: mute)
|
||||
expect(response.headers['Link'].find_link(%w(rel prev)).href).to eq api_v1_mutes_url(since_id: mute)
|
||||
end
|
||||
|
||||
it 'returns http success' do
|
||||
|
|
|
@ -73,7 +73,7 @@ describe Settings::ApplicationsController do
|
|||
name: 'My New App',
|
||||
redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',
|
||||
website: 'http://google.com',
|
||||
scopes: ['read', 'write', 'follow'],
|
||||
scopes: %w(read write follow),
|
||||
},
|
||||
}
|
||||
response
|
||||
|
|
|
@ -23,7 +23,7 @@ describe Settings::Preferences::OtherController do
|
|||
expect(response).to redirect_to(settings_preferences_other_path)
|
||||
user.reload
|
||||
expect(user.locale).to eq 'en'
|
||||
expect(user.chosen_languages).to eq ['es', 'fr']
|
||||
expect(user.chosen_languages).to eq %w(es fr)
|
||||
end
|
||||
|
||||
it 'updates user settings' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue