Permalink
Browse files

making some tests more itempotent

  • Loading branch information...
1 parent 27799cb commit b931c7a9fe3ac66e359869243a9a2102e7bc6fbf @rauhryan rauhryan committed Apr 6, 2012
Showing with 6 additions and 5 deletions.
  1. +1 −1 spec/ghee/api/repos_spec.rb
  2. +5 −4 spec/ghee/api/teams_spec.rb
@@ -33,7 +33,7 @@ def should_be_a_repo(repo)
describe "#labels" do
it "should return all the labels" do
VCR.use_cassette("repo(#{GH_USER},#{GH_REPO}).labels") do
- temp_label = subject.repos(GH_USER, GH_REPO).labels.create(:color => "efefef", :name => "temp label")
+ temp_label = subject.repos(GH_USER, GH_REPO).labels.create({:color => "efefef", :name => "#{(0...8).map{ ('a'..'z').to_a[rand(26)] }.join}"})
labels = subject.repos(GH_USER, GH_REPO).labels
labels.size.should > 0
@@ -14,7 +14,7 @@ def should_be_a_team(team)
before :all do
VCR.use_cassette "orgs.teams.create.test" do
@test_team = subject.orgs(GH_ORG).teams.create({
- :name => "test_team"
+ :name => "#{(0...8).map{ ('a'..'z').to_a[rand(26)] }.join}"
})
@test_team.should_not be_nil
end
@@ -25,7 +25,7 @@ def should_be_a_team(team)
before :all do
VCR.use_cassette "orgs.teams.create.test_member" do
@member_team = subject.orgs(GH_ORG).teams.create({
- :name => "test_team_with_members"
+ :name => "#{(0...8).map{ ('a'..'z').to_a[rand(26)] }.join}"
})
@member_team.should_not be_nil
end
@@ -69,11 +69,12 @@ def should_be_a_team(team)
it "should patch the team" do
VCR.use_cassette "orgs.teams.patch" do
+ name = "#{(0...8).map{ ('a'..'z').to_a[rand(26)] }.join}"
team = subject.orgs(GH_ORG).teams(test_team['id']).patch({
- :name => "herpderp"
+ :name => name
})
should_be_a_team team
- team["name"].should == "herpderp"
+ team["name"].should == name
end
end

0 comments on commit b931c7a

Please sign in to comment.