From 37f6390910eb1e3fe0d61393df1347c79ddc5b37 Mon Sep 17 00:00:00 2001 From: "Vladmir Sharhsov(warpc)" Date: Tue, 21 May 2013 20:55:29 +0400 Subject: [PATCH] Allow all users use search method for advisories --- app/models/ability.rb | 2 +- spec/controllers/advisories_controller_spec.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 spec/controllers/advisories_controller_spec.rb diff --git a/app/models/ability.rb b/app/models/ability.rb index 32a79f945..52c080448 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -21,7 +21,7 @@ class Ability can :search, BuildList can [:read, :log, :everything], BuildList, :project => {:visibility => 'open'} can [:read, :log], ProductBuildList#, :product => {:platform => {:visibility => 'open'}} # double nested hash don't work - can :read, Advisory + can [:read, :search], Advisory # Platforms block can [:show, :members, :advisories], Platform, :visibility => 'open' diff --git a/spec/controllers/advisories_controller_spec.rb b/spec/controllers/advisories_controller_spec.rb new file mode 100644 index 000000000..f2006fd93 --- /dev/null +++ b/spec/controllers/advisories_controller_spec.rb @@ -0,0 +1,11 @@ +# -*- encoding : utf-8 -*- +require 'spec_helper' + +describe AdvisoriesController do + context 'for all' do + it "should be able to perform search action" do + get :search + response.should_not redirect_to(forbidden_path) + end + end +end \ No newline at end of file