describe SystemPicturesController do
before do
@admin = FactoryGirl.create :admin
+ @demand_user = FactoryGirl.create :demand_user
@user = FactoryGirl.create( :user_yas)
@author = FactoryGirl.create :author, :user_id => @user.id
@artist = FactoryGirl.create :artist_yas, :author_id => @author.id
describe '一覧表示に於いて' do
before do
sign_in @user
- sign_in @admin
SystemPicture.stub(:list).and_return([@sp, @sp, @sp])
end
context 'パラメータpageについて' do
end
end
end
+ context '作家権限はないが管理者権限があるとき' do
+ before do
+ sign_out @user
+ sign_in @admin
+ end
+ it 'ステータスコード200 OKを返す' do
+ get :index
+ response.should be_success
+ end
+ end
+ context '作家権限はないが借手権限があるとき' do
+ before do
+ sign_out @user
+ sign_in @demand_user
+ end
+ it 'ステータスコード200 OKを返す' do
+ get :index
+ response.should be_success
+ end
+ end
end
describe '単体表示に於いて' do
end
end
end
+ context '作家権限はないが管理者権限があるとき' do
+ before do
+ sign_out @user
+ sign_in @admin
+ end
+ it 'ステータスコード200 OKを返す' do
+ get :show, :id => @sp.id
+ response.should be_success
+ end
+ end
+ context '作家権限はないが借手権限があるとき' do
+ before do
+ sign_out @user
+ sign_in @demand_user
+ end
+ it 'ステータスコード200 OKを返す' do
+ get :show, :id => @sp.id
+ response.should be_success
+ end
+ end
=begin
context '対象システム画像がないとき' do
before do