#465: Update specs for Platforms::MaintainersController

This commit is contained in:
Vokhmin Alexey V 2015-04-03 00:50:30 +03:00
parent 518e410767
commit da2c6ee921
2 changed files with 4 additions and 5 deletions

View File

@ -1,7 +1,6 @@
class Platforms::MaintainersController < ApplicationController
class Platforms::MaintainersController < Platforms::BaseController
before_action :authenticate_user!
skip_before_action :authenticate_user!, only: [:index] if APP_CONFIG['anonymous_access']
load_and_authorize_resource :platform
def index
@maintainer = BuildList::Package.new(params[:build_list_package])

View File

@ -4,7 +4,7 @@ shared_examples_for 'guest user' do
it "should be able to view maintainers list(index)" do
get :index, platform_id: @platform.id
response.should be_success
expect(response).to be_success
end
end
@ -22,12 +22,12 @@ describe Platforms::MaintainersController, type: :controller do
it "should be able to view maintainers list(index)", anonymous_access: true do
get :index, platform_id: @platform.id
response.should be_success
expect(response).to be_success
end
it "should not be able to view maintainers list(index)", anonymous_access: false do
get :index, platform_id: @platform.id
response.should redirect_to(new_user_session_path)
expect(response).to redirect_to(new_user_session_path)
end
end