spec/github/gists_spec.rb in github_api-0.5.1 vs spec/github/gists_spec.rb in github_api-0.5.2
- old
+ new
@@ -19,27 +19,27 @@
to_return(:body => fixture('gists/gists.json'), :status => 200,
:headers => {:content_type => "application/json; charset=utf-8"})
end
it "should get the resources" do
- github.gists.list user
+ github.gists.list :user => user
a_get("/users/#{user}/gists").should have_been_made
end
it "should return array of resources" do
- gists = github.gists.list user
+ gists = github.gists.list :user => user
gists.should be_an Array
gists.should have(1).items
end
it "should be a mash type" do
- gists = github.gists.list user
+ gists = github.gists.list :user => user
gists.first.should be_a Hashie::Mash
end
it "should get gist information" do
- gists = github.gists.list user
+ gists = github.gists.list :user => user
gists.first.user.login.should == 'octocat'
end
it "should yield to a block" do
github.gists.should_receive(:list).with(user).and_yield('web')
@@ -53,10 +53,10 @@
to_return(:body => "", :status => [404, "Not Found"])
end
it "should return 404 with a message 'Not Found'" do
expect {
- github.gists.list user
+ github.gists.list :user => user
}.to raise_error(Github::Error::NotFound)
end
end
end # unauthenticated user