From 8819d0845af7131e9c55dd164365b8c80f00448d Mon Sep 17 00:00:00 2001 From: Vladimir Sharshov Date: Sat, 5 May 2012 23:26:34 +0400 Subject: [PATCH] [refs 428] Fix tests and merges missing --- app/controllers/projects/build_lists_controller.rb | 2 +- spec/factories/build_lists.rb | 2 +- spec/models/cancan_spec.rb | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index 6e497de1e..f90402ae9 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -48,7 +48,7 @@ class Projects::BuildListsController < Projects::BaseController @build_list.commit_hash = @project.git_repository.commits(@build_list.project_version.match(/^latest_(.+)/).to_a.last || @build_list.project_version).first.id if @build_list.project_version @build_list.build_for_platform = build_for_platform; @build_list.arch = arch; @build_list.user = current_user @build_list.include_repos = @build_list.include_repos.select {|ir| @build_list.build_for_platform.repository_ids.include? ir.to_i} - @build_list.priority = 100 # User builds more priority than mass rebuild with zero priority + @build_list.priority = current_user.build_priority # User builds more priority than mass rebuild with zero priority flash_options = {:project_version => @build_list.project_version, :arch => arch.name, :build_for_platform => build_for_platform.name, :save_to_platform => @build_list.save_to_platform} if @build_list.save notices << t("flash.build_list.saved", flash_options) diff --git a/spec/factories/build_lists.rb b/spec/factories/build_lists.rb index 2a08e1b9d..88dda9c27 100644 --- a/spec/factories/build_lists.rb +++ b/spec/factories/build_lists.rb @@ -3,7 +3,7 @@ FactoryGirl.define do factory :build_list do association :user association :project - association save_to_platform, :factory => :platform_with_repos + association :save_to_platform, :factory => :platform_with_repos association :arch build_for_platform {|bl| bl.save_to_platform} project_version "1.0" diff --git a/spec/models/cancan_spec.rb b/spec/models/cancan_spec.rb index d2317f33b..652d77834 100644 --- a/spec/models/cancan_spec.rb +++ b/spec/models/cancan_spec.rb @@ -94,7 +94,9 @@ describe CanCan do end end - it { @ability.should be_able_to(:show, User) } + it "shoud be able to show user profile" do + @ability.should be_able_to(:show, User) + end it "shoud be able to read another user object" do admin_create