#794: fixes for failed specs
This commit is contained in:
parent
c72968ba2a
commit
0ad9932561
1
Gemfile
1
Gemfile
|
@ -89,4 +89,5 @@ group :test do
|
||||||
gem 'factory_girl_rails', '~> 4.0.0'
|
gem 'factory_girl_rails', '~> 4.0.0'
|
||||||
gem 'rr', '~> 1.0.4'
|
gem 'rr', '~> 1.0.4'
|
||||||
gem 'shoulda'
|
gem 'shoulda'
|
||||||
|
gem 'mock_redis', '0.6.2'
|
||||||
end
|
end
|
||||||
|
|
|
@ -175,6 +175,7 @@ GEM
|
||||||
meta-tags (1.2.6)
|
meta-tags (1.2.6)
|
||||||
actionpack
|
actionpack
|
||||||
mime-types (1.19)
|
mime-types (1.19)
|
||||||
|
mock_redis (0.6.2)
|
||||||
multi_json (1.5.0)
|
multi_json (1.5.0)
|
||||||
mustache (0.99.4)
|
mustache (0.99.4)
|
||||||
net-scp (1.0.4)
|
net-scp (1.0.4)
|
||||||
|
@ -391,6 +392,7 @@ DEPENDENCIES
|
||||||
jquery-rails (~> 2.0.2)
|
jquery-rails (~> 2.0.2)
|
||||||
mailcatcher
|
mailcatcher
|
||||||
meta-tags (~> 1.2.5)
|
meta-tags (~> 1.2.5)
|
||||||
|
mock_redis (= 0.6.2)
|
||||||
newrelic_rpm (~> 3.4.1)
|
newrelic_rpm (~> 3.4.1)
|
||||||
omniauth (~> 1.1.0)
|
omniauth (~> 1.1.0)
|
||||||
omniauth-openid (~> 1.0.1)
|
omniauth-openid (~> 1.0.1)
|
||||||
|
|
|
@ -127,8 +127,8 @@ shared_examples_for 'api repository user with writer rights' do
|
||||||
|
|
||||||
context 'api repository user with update signatures rights' do
|
context 'api repository user with update signatures rights' do
|
||||||
before do
|
before do
|
||||||
stub_key_pairs_calls
|
kp = FactoryGirl.build(:key_pair)
|
||||||
put :signatures, :id => @repository.id, :repository => {:public => 'iampublic', :secret => 'iamsecret'}, :format => :json
|
put :signatures, :id => @repository.id, :repository => {:public => kp.public, :secret => kp.secret}, :format => :json
|
||||||
end
|
end
|
||||||
it 'should be able to perform signatures action' do
|
it 'should be able to perform signatures action' do
|
||||||
response.should be_success
|
response.should be_success
|
||||||
|
@ -228,8 +228,8 @@ shared_examples_for 'api repository user without writer rights' do
|
||||||
|
|
||||||
context 'api repository user without update signatures rights' do
|
context 'api repository user without update signatures rights' do
|
||||||
before do
|
before do
|
||||||
stub_key_pairs_calls
|
kp = FactoryGirl.build(:key_pair)
|
||||||
put :signatures, :id => @repository.id, :repository => {:public => 'iampublic', :secret => 'iamsecret'}, :format => :json
|
put :signatures, :id => @repository.id, :repository => {:public => kp.public, :secret => kp.secret}, :format => :json
|
||||||
end
|
end
|
||||||
it 'should not be able to perform signatures action' do
|
it 'should not be able to perform signatures action' do
|
||||||
response.should_not be_success
|
response.should_not be_success
|
||||||
|
|
|
@ -69,17 +69,17 @@ end
|
||||||
describe Platforms::KeyPairsController do
|
describe Platforms::KeyPairsController do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
stub_symlink_methods
|
stub_symlink_methods
|
||||||
stub_key_pairs_calls
|
|
||||||
|
|
||||||
@platform = FactoryGirl.create(:platform)
|
@platform = FactoryGirl.create(:platform)
|
||||||
@repository = FactoryGirl.create(:repository, :platform => @platform)
|
@repository = FactoryGirl.create(:repository, :platform => @platform)
|
||||||
@user = FactoryGirl.create(:user)
|
@user = FactoryGirl.create(:user)
|
||||||
|
kp = FactoryGirl.build(:key_pair)
|
||||||
@create_params = {
|
@create_params = {
|
||||||
:platform_id => @platform,
|
:platform_id => @platform,
|
||||||
:key_pair => {
|
:key_pair => {
|
||||||
:repository_id => @repository,
|
:repository_id => @repository,
|
||||||
:public => "iampublic",
|
:public => kp.public,
|
||||||
:secret => "iamsecret"
|
:secret => kp.secret
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -84,6 +84,8 @@ end
|
||||||
describe Platforms::ProductBuildListsController do
|
describe Platforms::ProductBuildListsController do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
stub_symlink_methods
|
stub_symlink_methods
|
||||||
|
redis_instance = MockRedis.new
|
||||||
|
stub(Redis).new { redis_instance }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'crud' do
|
context 'crud' do
|
||||||
|
|
|
@ -3,7 +3,6 @@ require 'spec_helper'
|
||||||
describe KeyPair do
|
describe KeyPair do
|
||||||
before(:all) do
|
before(:all) do
|
||||||
stub_symlink_methods
|
stub_symlink_methods
|
||||||
stub_key_pairs_calls
|
|
||||||
FactoryGirl.create(:key_pair)
|
FactoryGirl.create(:key_pair)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -46,12 +46,6 @@ def stub_symlink_methods
|
||||||
any_instance_of(Platform, :remove_symlink_directory => true)
|
any_instance_of(Platform, :remove_symlink_directory => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def stub_key_pairs_calls
|
|
||||||
stub(BuildServer).import_gpg_key_pair { [0,"1a2b3c"] }
|
|
||||||
stub(BuildServer).set_repository_key { 0 }
|
|
||||||
stub(BuildServer).rm_repository_key { 0 }
|
|
||||||
end
|
|
||||||
|
|
||||||
Resque.inline = true
|
Resque.inline = true
|
||||||
|
|
||||||
def init_test_root
|
def init_test_root
|
||||||
|
|
Loading…
Reference in New Issue