×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Ruby
Posted by: Adam Bedell
Added: Aug 16, 2013 1:20 AM
Views: 39
  1. Feature: Sign In
  2.  
  3.     Background:
  4.       Given I send and accept JSON
  5.  
  6.     Scenario: Successful sign in using email and password
  7.       Given "Adam" is a user with email id "user@gmail.com" and password "password123"
  8.         And his role is "admin"
  9.         And his authentication token is "auth_token_123"
  10.       When I authenticate as the user "user@gmail.com" with the password "password123"
  11.       And I send a POST request to "/api/users/sign_in"
  12.       Then the response status should be "200"
  13.       And the JSON response should have "auth_token"
  14.         And the auth_token should be different from "auth_token_123"
  15.       And the JSON response at "user_role" should be "admin"