|
17 | 17 | describe 'GET #search' do # rubocop:todo RSpec/MultipleMemoizedHelpers |
18 | 18 | let!(:john_doe) { create(:better_together_person, name: 'John Doe', privacy: 'public') } |
19 | 19 |
|
20 | | - it 'returns searchable people as JSON' do # rubocop:todo RSpec/ExampleLength, RSpec/MultipleExpectations |
| 20 | + it 'returns searchable people as JSON' do # rubocop:todo RSpec/ExampleLength |
21 | 21 | get :search, params: { locale: locale, q: 'John' }, format: :json |
22 | 22 |
|
23 | 23 | expect(response).to have_http_status(:success) |
|
28 | 28 | expect(json_response.first['value']).to eq(john_doe.id.to_s) |
29 | 29 | end |
30 | 30 |
|
31 | | - it 'excludes already blocked people from search results' do # rubocop:todo RSpec/MultipleExpectations |
| 31 | + it 'excludes already blocked people from search results' do |
32 | 32 | blocked_user = create(:better_together_person, name: 'Blocked User', privacy: 'public') |
33 | 33 | create(:person_block, blocker: person, blocked: blocked_user) |
34 | 34 |
|
|
38 | 38 | expect(JSON.parse(response.body)).to be_empty |
39 | 39 | end |
40 | 40 |
|
41 | | - it 'excludes current user from search results' do # rubocop:todo RSpec/MultipleExpectations |
| 41 | + it 'excludes current user from search results' do |
42 | 42 | get :search, params: { locale: locale, q: person.name }, format: :json |
43 | 43 |
|
44 | 44 | expect(response).to have_http_status(:success) |
|
111 | 111 | context 'when not authenticated' do |
112 | 112 | before { sign_out user } |
113 | 113 |
|
114 | | - it 'redirects to sign in' do # rubocop:todo RSpec/MultipleExpectations |
| 114 | + it 'redirects to sign in' do |
115 | 115 | get :index, params: { locale: locale } |
116 | 116 | expect(response).to have_http_status(:redirect) |
117 | 117 | expect(response.location).to include('/users/sign-in') |
|
134 | 134 | context 'when not authenticated' do |
135 | 135 | before { sign_out user } |
136 | 136 |
|
137 | | - it 'redirects to sign in' do # rubocop:todo RSpec/MultipleExpectations |
| 137 | + it 'redirects to sign in' do |
138 | 138 | get :new, params: { locale: locale } |
139 | 139 | expect(response).to have_http_status(:redirect) |
140 | 140 | expect(response.location).to include('/users/sign-in') |
|
244 | 244 | context 'when not authenticated' do |
245 | 245 | before { sign_out user } |
246 | 246 |
|
247 | | - it 'redirects to sign in' do # rubocop:todo RSpec/MultipleExpectations |
| 247 | + it 'redirects to sign in' do |
248 | 248 | post :create, params: { locale: locale, person_block: { blocked_id: blocked_person.id } } |
249 | 249 | expect(response).to have_http_status(:redirect) |
250 | 250 | expect(response.location).to include('/users/sign-in') |
|
293 | 293 | context 'when not authenticated' do # rubocop:todo RSpec/MultipleMemoizedHelpers |
294 | 294 | before { sign_out user } |
295 | 295 |
|
296 | | - it 'redirects to sign in' do # rubocop:todo RSpec/MultipleExpectations |
| 296 | + it 'redirects to sign in' do |
297 | 297 | delete :destroy, params: { locale: locale, id: person_block.id } |
298 | 298 | expect(response).to have_http_status(:redirect) |
299 | 299 | expect(response.location).to include('/users/sign-in') |
|
0 commit comments