Welcome to TagMyCode

Please login or create account to add a snippet.
Language: Ruby
Posted by: Adam Bedell
Added: Aug 16, 2013 1:20 AM
Views: 1836
  1. Feature: Sign In
  3.     Background:
  4.       Given I send and accept JSON
  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"