spec/github/repos/comments/create_spec.rb in github_api-0.8.0 vs spec/github/repos/comments/create_spec.rb in github_api-0.8.1
- old
+ new
@@ -31,34 +31,10 @@
expect {
subject.create user, repo, sha, inputs.except('body')
}.to raise_error(Github::Error::RequiredParams)
end
- it "should fail to create resource if 'commit_id' input is missing" do
- expect {
- subject.create user, repo, sha, inputs.except(:commit_id)
- }.to raise_error(Github::Error::RequiredParams)
- end
-
- it "should fail to create resource if 'line' input is missing" do
- expect {
- subject.create user, repo, sha, inputs.except(:line)
- }.to raise_error(Github::Error::RequiredParams)
- end
-
- it "should fail to create resource if 'path' input is missing" do
- expect {
- subject.create user, repo, sha, inputs.except(:path)
- }.to raise_error(Github::Error::RequiredParams)
- end
-
- it "should fail to create resource if 'position' input is missing" do
- expect {
- subject.create user, repo, sha, inputs.except(:position)
- }.to raise_error(Github::Error::RequiredParams)
- end
-
it "should create resource successfully" do
subject.create user, repo, sha, inputs
a_post(request_path).with(inputs).should have_been_made
end
@@ -71,16 +47,9 @@
comment = subject.create user, repo, sha, inputs
comment.user.login.should == 'octocat'
end
end
- context "failed to create resource" do
- let(:body) { '' }
- let(:status) { 404 }
-
- it "should fail to retrieve resource" do
- expect {
- subject.create user, repo, sha, inputs
- }.to raise_error(Github::Error::NotFound)
- end
+ it_should_behave_like 'request failure' do
+ let(:requestable) { subject.create user, repo, sha, inputs }
end
end # create