Created
April 10, 2012 09:30
-
-
Save nickboyce/2349801 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
context "#index (GET /artworks.json)" do | |
# create 30 Artwork documents using FactoryGirl, and do a HTTP GET request on "/artworks.json" | |
before(:each) do | |
30.times { FactoryGirl.create(:artwork) } | |
get "/artworks.json" | |
end | |
describe "should list all artworks" do | |
# the request returns a variable called "response", which we can then make sure comes back as expected | |
it { response.should be_ok } | |
it { JSON.parse(response.body)["results"].should be_a_kind_of(Array) } | |
it { JSON.parse(response.body)["results"].length.should eq 30 } | |
# etc... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment