Skip to content

Commit

Permalink
specs for unexisting user invitation
Browse files Browse the repository at this point in the history
  • Loading branch information
santiago-dev96 committed Jan 24, 2020
1 parent 3aa7b72 commit fccdccb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/controllers/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@
expect(@another_user.inviting_events.count).to eq(1)
end

it 'does not invite unexisting users' do
post(
:invite,
params: {
id: @user.id,
event_id: @event.id,
invitation: {
users: 'harry'
}
}
)

expect(@event.inviteds.count).to eq(2)
end

it 'redirects to event show' do
expect(response).to redirect_to(event_url(@event))
end
Expand Down

0 comments on commit fccdccb

Please sign in to comment.