From 9914b17c56a81bc4577f6c86d8bcea887a8d3eb9 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Tue, 9 Apr 2013 01:58:50 +0400 Subject: [PATCH] #82: some refactoring of code --- .../platforms/repositories_controller_spec.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/controllers/platforms/repositories_controller_spec.rb b/spec/controllers/platforms/repositories_controller_spec.rb index 1cfeadc32..80cca3236 100644 --- a/spec/controllers/platforms/repositories_controller_spec.rb +++ b/spec/controllers/platforms/repositories_controller_spec.rb @@ -241,8 +241,8 @@ describe Platforms::RepositoriesController do context 'for platform owner user' do before(:each) do @user = @repository.platform.owner - @personal_repository.platform.owner = @user - @personal_repository.platform.save + platform = @personal_repository.platform + platform.owner = @user; platform.save set_session_for(@user) end @@ -251,8 +251,9 @@ describe Platforms::RepositoriesController do context 'for platform member user' do before(:each) do - @platform.relations.create!(:actor_type => 'User', :actor_id => @user.id, :role => 'admin') - @personal_repository.platform.relations.create!(:actor_type => 'User', :actor_id => @user.id, :role => 'admin') + [@repository, @personal_repository].each do |repo| + repo.platform.relations.create!(:actor_type => 'User', :actor_id => @user.id, :role => 'admin') + end end it_should_behave_like 'platform admin user' @@ -260,8 +261,9 @@ describe Platforms::RepositoriesController do context 'for repository member user' do before(:each) do - @repository.relations.create!(:actor_type => 'User', :actor_id => @user.id, :role => 'admin') - @personal_repository.relations.create!(:actor_type => 'User', :actor_id => @user.id, :role => 'admin') + [@repository, @personal_repository].each do |repo| + repo.relations.create!(:actor_type => 'User', :actor_id => @user.id, :role => 'admin') + end end it_should_behave_like 'registered user'