Created
October 2, 2015 03:22
-
-
Save sbwoodside/19d3e033076de2bd1194 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'acceptance_helper' | |
resource "Measurements" do | |
fixtures :users | |
let(:client) { RspecApiDocumentation::RackTestClient.new(self, :headers => { "HTTP_ACCEPT" => "application/json" }) } | |
post "/users/sign_in" do | |
let(:email) { "cam@cam.cam" } | |
let(:password) { "cam@cam.cam" } | |
example "Authenticate with login and password" do | |
do_request | |
status.should == 200 | |
$session_cookie = response_headers['Set-Cookie'] | |
end | |
end | |
get "/measurements" do | |
let(:client) { RspecApiDocumentation::RackTestClient.new(self, :headers => { "HTTP_ACCEPT" => "application/json", 'Cookie' => $session_cookie }) } | |
puts '$session_cookie: ' + $session_cookie.to_s # This is coming out nil because this spec is running first | |
example "Listing measurements" do | |
do_request | |
status.should == 200 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment