Given the JSON response:
{ "tags": [ { "id": 81499, "name": "sign-in" }, { "id": 81500, "name": "user" }, { "id": 81501, "name": "authentication" } ] }
Using RSpec 2, I want to verify that this answer contains a tag with name authentication. Being fairly new to Ruby, I decided that there was a more efficient way than repeating an array and checking each name value with include? or collect cards. I could just use regex to validate / authenticate / i, but that doesn't seem like the best approach.
This is my specification:
it "allows filtering" do response = @client.story(15404)
source share