- sender_token = create(:oauth_access_token,
- :resource_owner_id => sender.id,
- :scopes => %w[consume_messages])
- sender_auth = bearer_authorization_header(sender_token.token)
-
- recipient_token = create(:oauth_access_token,
- :resource_owner_id => recipient.id,
- :scopes => %w[consume_messages])
- recipient_auth = bearer_authorization_header(recipient_token.token)
-
- user3_token = create(:oauth_access_token,
- :resource_owner_id => user3.id,
- :scopes => %w[send_messages consume_messages])
- user3_auth = bearer_authorization_header(user3_token.token)
+ sender_auth = bearer_authorization_header(sender, :scopes => %w[consume_messages])
+ recipient_auth = bearer_authorization_header(recipient, :scopes => %w[consume_messages])
+ user3_auth = bearer_authorization_header(user3, :scopes => %w[send_messages consume_messages])