|
1 | 1 | require 'spec_helper' |
2 | 2 |
|
3 | | -describe Github::Issues::Labels, :type => :base do |
| 3 | +describe Github::Issues::Labels do |
| 4 | + let(:github) { Github.new } |
| 5 | + let(:user) { 'peter-murach' } |
| 6 | + let(:repo) { 'github' } |
| 7 | + |
| 8 | + after { github.user, github.repo, github.oauth_token = nil, nil, nil } |
4 | 9 |
|
5 | 10 | it { described_class::VALID_LABEL_INPUTS.should_not be_nil } |
6 | 11 |
|
|
123 | 128 | it "should fail to create resource if 'name' input is missing" do |
124 | 129 | expect { |
125 | 130 | github.issues.create_label user, repo, inputs.except('name') |
126 | | - }.to raise_error(ArgumentError) |
| 131 | + }.to raise_error(Github::Error::RequiredParams) |
127 | 132 | end |
128 | 133 |
|
129 | 134 | it "should fail to create resource if 'color' input is missing" do |
130 | 135 | expect { |
131 | 136 | github.issues.create_label user, repo, inputs.except('color') |
132 | | - }.to raise_error(ArgumentError) |
| 137 | + }.to raise_error(Github::Error::RequiredParams) |
133 | 138 | end |
134 | 139 |
|
135 | 140 | it "should create resource successfully" do |
|
181 | 186 | it "should fail to create resource if 'name' input is missing" do |
182 | 187 | expect { |
183 | 188 | github.issues.update_label user, repo, label_id, inputs.except('name') |
184 | | - }.to raise_error(ArgumentError) |
| 189 | + }.to raise_error(Github::Error::RequiredParams) |
185 | 190 | end |
186 | 191 |
|
187 | 192 | it "should fail to create resource if 'color' input is missing" do |
188 | 193 | expect { |
189 | 194 | github.issues.update_label user, repo, label_id, inputs.except('color') |
190 | | - }.to raise_error(ArgumentError) |
| 195 | + }.to raise_error(Github::Error::RequiredParams) |
191 | 196 | end |
192 | 197 |
|
193 | 198 | it "should update resource successfully" do |
|
274 | 279 |
|
275 | 280 | it "should fail to get resource without issue_id" do |
276 | 281 | expect { |
277 | | - github.issues.labels_for user, repo, nil |
| 282 | + github.issues.labels_for user, repo, nil |
278 | 283 | }.to raise_error(ArgumentError) |
279 | 284 | end |
280 | 285 |
|
281 | 286 | it "should get the resources" do |
282 | 287 | github.issues.labels_for user, repo, issue_id |
283 | | - a_get("/repos/#{user}/#{repo}/issues/#{issue_id}/labels").should have_been_made |
| 288 | + a_get("/repos/#{user}/#{repo}/issues/#{issue_id}/labels"). |
| 289 | + should have_been_made |
284 | 290 | end |
285 | 291 |
|
286 | 292 | it "should return array of resources" do |
|
0 commit comments