Skip to content

Commit

Permalink
Fix failing repo spec
Browse files Browse the repository at this point in the history
  • Loading branch information
iNecas committed Aug 31, 2011
1 parent 7024769 commit c706d44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/models/glue/pulp/repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def update_repos
self.productContent.select {|pc| added_content.include?(pc.content.label)}.each do |pc|
if !(self.environments.map(&:name).any? {|name| pc.content.name.include?(name)}) || pc.content.name.include?('Locker')
Rails.logger.debug "creating repository #{repo_id(pc.content.name)}"
self.add_repo(pc.content.name, repository_url(pc.feed))
self.add_repo(pc.content.name, repository_url(pc.content.contentUrl))
else
raise "new content was added to environment other than Locker. use promotion instead."
end
Expand Down
8 changes: 4 additions & 4 deletions src/spec/models/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@

before :each do
stub_reference_objects
@locker = mock(KPEnvironment, {:id => RepoTestData::REPO_ENV_ID, :name => 'Locker'})
@locker = mock(KTEnvironment, {:id => RepoTestData::REPO_ENV_ID, :name => 'Locker'})
@locker.stub(:organization).and_return(@org)
@to_env = mock(KPEnvironment, {:id => RepoTestData::CLONED_REPO_ENV_ID, :name => 'Prod'})
@to_env = mock(KTEnvironment, {:id => RepoTestData::CLONED_REPO_ENV_ID, :name => 'Prod'})
@to_env.stub(:organization).and_return(@org)
@product.stub(:locker).and_return(@locker)

Expand Down Expand Up @@ -273,8 +273,8 @@ def stub_reference_objects
@org = mock(Organization, {:id => RepoTestData::REPO_ORG_ID, :name => "Corp"})
Organization.stub(:find).with(RepoTestData::REPO_ORG_ID).and_return(@org)

@env = mock(KPEnvironment, {:id => RepoTestData::REPO_ENV_ID, :name => "Dev"})
KPEnvironment.stub(:find).with(RepoTestData::REPO_ENV_ID).and_return(@env)
@env = mock(KTEnvironment, {:id => RepoTestData::REPO_ENV_ID, :name => "Dev"})
KTEnvironment.stub(:find).with(RepoTestData::REPO_ENV_ID).and_return(@env)

@product = mock(Product, {:id => RepoTestData::REPO_PRODUCT_ID, :cp_id => RepoTestData::REPO_PRODUCT_CP_ID, :name => "Ruby"})
Product.stub(:find).with(RepoTestData::REPO_PRODUCT_ID).and_return(@product)
Expand Down

0 comments on commit c706d44

Please sign in to comment.