Skip to content

Commit

Permalink
Basic data.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankshearar committed Aug 21, 2013
1 parent 2dfd2b1 commit f84b41c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
27 changes: 27 additions & 0 deletions spec/configuration_spec.rb
Expand Up @@ -81,6 +81,33 @@ module OctoHerder
conf.update_labels connection
end

context "with pre-existing labels" do
let (:existing_labels) { [{
"url" => "https =>//api.github.com/repos/me/mine/labels/critical",
"name" => "critical",
"color" => "ff0000"
}] }

before :each do
connection.stub(:labels).and_return(existing_labels)
connection.stub(:add_label)
connection.stub(:delete_label)
end

it "should add missing labels with the colours of those in the master repo" do
connection.should_receive(:add_label).with(an_instance_of(Octokit::Repository), 'critical', 'ff0000')

conf.update_labels connection
end

it "should change existing labels to match the colours of those in the master repo" do
connection.should_receive(:delete_label).with(an_instance_of(Octokit::Repository), 'critical').ordered
connection.should_receive(:add_label).with(an_instance_of(Octokit::Repository), 'critical', 'ff0000')

conf.update_labels connection
end
end

it "should ask all repositories for their milestones" do
connection.stub(:list_milestones).and_return(LIST_MILESTONES_FOR_A_REPOSITORY,
[],
Expand Down
3 changes: 2 additions & 1 deletion spec/data/sample.yml
Expand Up @@ -28,4 +28,5 @@ labels:
- 3
- 5
- 8
- 13
- 13
- critical

0 comments on commit f84b41c

Please sign in to comment.