Fix tournament index spec apply wrong auth header
because the user @owner doesn't have any private tournaments, therefore the spec was pointless
This commit is contained in:
parent
09ca262ab1
commit
c4d03b52c3
|
|
@ -33,10 +33,12 @@ RSpec.describe TournamentsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'returns private tournaments owned by the authenticated user' do
|
||||
apply_authentication_headers_for @user
|
||||
apply_authentication_headers_for @another_user
|
||||
get :index
|
||||
tournaments = deserialize_response response
|
||||
expect(tournaments.filter { |t| !t[:public] }).to match_array(Tournament.where(owner: @owner, public: false))
|
||||
private_tournaments = Tournament.where(owner: @another_user, public: false).map { |t| t[:id] }
|
||||
returned_private_tournaments = tournaments.filter { |t| !t[:public] }.map { |t| t[:id] }
|
||||
expect(returned_private_tournaments).to match_array(private_tournaments)
|
||||
end
|
||||
|
||||
it 'returns no private tournaments owned by another user' do
|
||||
|
|
|
|||
Loading…
Reference in New Issue