Skip to content

Commit

Permalink
Update room leave spec
Browse files Browse the repository at this point in the history
  • Loading branch information
hmlON committed Jul 23, 2017
1 parent c1f8240 commit 7efadc8
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions spec/features/rooms_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,30 @@
# end
end

# scenario 'User leaves room' do
# user = room.users.first
# sign_in user
# visit dashboard_path
# click_link 'Room settings'
#
# click_button 'Leave room'
# within '#leaveRoomModal' do
# click_on 'Leave room'
# end
#
# user.reload
# expect(user.room).to be_nil
# expect(Room.where(id: room.id)).to be_empty
# end
#
context 'leaving' do
let(:room) { create :room }
let(:user) { create :user }

background do
room.users << user

sign_in user
visit dashboard_path
click_link 'Room settings'
end

scenario 'User leaves room' do
click_button 'Leave room'
within '#leaveRoomModal' do
click_on 'Leave room'
end

user.reload
expect(user.room).to be_nil
expect(Room.where(id: room.id)).to be_empty
end
end

# scenario 'User looks at all rooms' do
# rooms = create_list(:room, 3)
#
Expand Down

0 comments on commit 7efadc8

Please sign in to comment.