Acceptance tests for user

This commit is contained in:
2015-09-17 17:46:33 +02:00
parent 8e931cabd4
commit cb744943bd
35 changed files with 91 additions and 49 deletions
+4 -4
View File
@@ -36,7 +36,7 @@ describe List do
expect{
list.send_table_join_request_for_user! other_user
}.to broadcast_to_user(user.id).message('user_join_request').with(
hash_including(:users, :join_request)
hash_including(:payload)
)
end
end
@@ -74,14 +74,14 @@ describe List do
it "broadcasts the event to the user itself" do
joining_user
expect{ list.approve_join_request_for_user! joining_user }
.to broadcast_to_user(joining_user).message('join_request_approved')
.with( hash_including(:user) )
.to broadcast_to_user(joining_user).message('join_request_approved')
.with( id: "jr-#{joining_user.id}" )
end
it "broadcasts the event to other associated users" do
expect{ list.approve_join_request_for_user! joining_user }
.to broadcast_to_user(user).message('join_request_approved')
.with( hash_including(:user) )
.with( id: "jr-#{joining_user.id}" )
end
end