spec/github/issues_spec.rb in github_api-0.7.0 vs spec/github/issues_spec.rb in github_api-0.7.1
- old
+ new
@@ -9,24 +9,23 @@
let(:repo) { 'github' }
let(:issue_id) { 1347 }
after { reset_authentication_for github }
- context 'access to apis' do
- it { subject.comments.should be_a Github::Issues::Comments }
- it { subject.events.should be_a Github::Issues::Events }
- it { subject.labels.should be_a Github::Issues::Labels }
- it { subject.milestones.should be_a Github::Issues::Milestones }
- end
+ its(:comments) { should be_a Github::Issues::Comments }
+ its(:events) { should be_a Github::Issues::Events }
+ its(:labels) { should be_a Github::Issues::Labels }
+ its(:milestones) { should be_a Github::Issues::Milestones }
context '#list' do
- it { github.issues.should respond_to(:all) }
+ it { should respond_to(:all) }
context "resource found" do
before do
stub_get("/issues").
- to_return(:body => fixture('issues/issues.json'), :status => 200, :headers => {:content_type => "application/json; charset=utf-8"})
+ to_return(:body => fixture('issues/issues.json'), :status => 200,
+ :headers => {:content_type => "application/json; charset=utf-8"})
end
it "should get the resources" do
github.issues.list
a_get("/issues").should have_been_made
@@ -65,16 +64,17 @@
end
end
end # list
describe '#list_repo' do
- it { github.issues.should respond_to :list_repository }
+ it { should respond_to :list_repository }
context "resource found" do
before do
stub_get("/repos/#{user}/#{repo}/issues").
- to_return(:body => fixture('issues/issues.json'), :status => 200, :headers => {:content_type => "application/json; charset=utf-8"})
+ to_return(:body => fixture('issues/issues.json'), :status => 200,
+ :headers => {:content_type => "application/json; charset=utf-8"})
end
it "should raise error if user-name empty" do
expect {
github.issues.list_repo nil, repo
@@ -121,11 +121,11 @@
end
end
end # list_repo
describe "#get" do
- it { github.issues.should respond_to :find }
+ it { should respond_to :find }
context "resource found" do
before do
stub_get("/repos/#{user}/#{repo}/issues/#{issue_id}").
to_return(:body => fixture('issues/issue.json'),
@@ -277,8 +277,8 @@
expect {
github.issues.edit user, repo, issue_id, inputs
}.to raise_error(Github::Error::NotFound)
end
end
- end # edit_issue
+ end # edit
end # Github::Issues