Skip to content
Permalink
Browse files
mutable state 😢
The issue here is that @card_id was getting clobbered by the 'When I GET to /cards' step. So
we'll make a new one for this test.

😢
  • Loading branch information
steveklabnik committed May 19, 2014
1 parent 85e6c1d commit febf0ff1eeb8dfa13ce3573a7af5238fe09371b2
Showing 1 changed file with 2 additions and 1 deletion.
@@ -97,13 +97,14 @@
step "I have tokenized a card"
@card_id = @client.last_body["cards"][0]["id"]
@card_url = @client.last_body["cards"][0]["href"]
@unstored_card_id = @card_id
step "I make a DELETE request to /cards/:card_id"
end

Then(/^I should not see that card in the results$/) do
card_ids = @client.last_body["cards"].collect{|card| card["id"]}
card_ids.each {|x|
assert x != @card_id
assert x != @unstored_card_id, "Card '#{@unstored_card_id}' was in the results"
}
end

0 comments on commit febf0ff

Please sign in to comment.