updated specs

This commit is contained in:
Vokhmin Alexey V 2015-02-19 04:53:47 +03:00
parent 52609f43b5
commit ec3ea92870
4 changed files with 8 additions and 5 deletions

View File

@ -57,7 +57,7 @@ shared_examples_for 'platform user with owner rights' do
response.should_not be_success
end
it 'ensures that personal platform has not been destroyed' do
lambda { delete :destroy, id: @personal_platform.id }.should_not change{ Platform.count }
lambda { delete :destroy, id: @personal_platform.id }.should change{ Platform.count }.by(0)
end
end
end
@ -249,7 +249,7 @@ shared_examples_for 'platform user with show rights' do
end
describe Platforms::PlatformsController, type: :controller do
let(:clone_or_create_params) { {id: @platform.id, platform: {description: 'new description', name: 'new_name', owner_id: @user.id, distrib_type: APP_CONFIG['distr_types'].first}} }
let(:clone_or_create_params) { {id: @platform.id, platform: {description: 'new description', name: 'new_name', owner_id: @user.id, distrib_type: APP_CONFIG['distr_types'].first, default_branch: 'new_name'}} }
before do
stub_symlink_methods

View File

@ -108,7 +108,7 @@ shared_examples_for 'registered user or guest' do
it 'should not be able to destroy repository in main platform' do
delete :destroy, id: @repository, platform_id: @platform
response.should redirect_to(redirect_path)
lambda { delete :destroy, id: @repository, platform_id: @platform }.should_not change{ Repository.count }.by(-1)
lambda { delete :destroy, id: @repository, platform_id: @platform }.should change{ Repository.count }.by(0)
end
it 'should not be able to destroy personal repository' do

View File

@ -1,6 +1,9 @@
FactoryGirl.define do
factory :rpm_build_node do
id { FactoryGirl.generate(:string) }
# id { FactoryGirl.generate(:string) }
user_id { FactoryGirl.create(:user).id }
before(:build) do |n|
n.send :id=, FactoryGirl.generate(:string)
end
end
end

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe ApiDefender do
describe ApiDefender, type: :request do
def get_basic_auth user = @user, by_token = false, by_email = false
u,pass = if by_token
[user.authentication_token, '']