@author = FactoryGirl.create :author, :user_id => @user.id\r
end\r
\r
+if MagicNumber['run_mode'] == 1\r
describe '一覧表示に於いて' do\r
before do\r
@panel = FactoryGirl.create :panel, :author_id => @author.id\r
assigns(:panels).should have_at_least(3).items\r
end\r
context 'html形式' do\r
+ it '@paginateにページ制御を取得している' do\r
+ get :index\r
+ assigns(:paginate).is_a?(Kaminari::PaginatableArray).should be_true\r
+ end\r
it 'ステータスコード200 OKを返す' do\r
get :index\r
response.should be_success \r
end\r
end\r
end\r
- context 'ä½\9c家権é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
+ context 'ã\83¦ã\83¼ã\82¶æ¨©é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
before do\r
sign_out @user\r
end\r
end\r
end\r
end\r
+ context 'ユーザ権限はないが管理者権限があるとき' do\r
+ before do\r
+ sign_out @user\r
+ sign_in @admin\r
+ end\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :index\r
+ response.should be_success \r
+ end\r
+ end\r
+ context 'ユーザだが作家登録していないとき' do\r
+ before do\r
+ @author.destroy\r
+ end\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :index\r
+ response.should be_success \r
+ end\r
+ end\r
end\r
\r
describe '単体表示に於いて' do\r
before do\r
@panel = FactoryGirl.create :panel, :author_id => @user.author.id\r
- Panel.stub(:show).with(@panel.id.to_s, @author).and_return(@panel)\r
+ Panel.stub(:show).with(@panel.id.to_s, [@user, nil]).and_return(@panel)\r
+ Panel.stub(:show).with(@panel.id.to_s, [nil, @admin]).and_return(@panel)\r
sign_in @user\r
end\r
context 'つつがなく終わるとき' do\r
end\r
end\r
end\r
- context 'ä½\9c家権é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
+ context 'ã\83¦ã\83¼ã\82¶æ¨©é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
before do\r
sign_out @user\r
end\r
end\r
end\r
end\r
+ context 'ユーザ権限はないが管理者権限があるとき' do\r
+ before do\r
+ sign_out @user\r
+ sign_in @admin\r
+ end\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :show, :id => @panel.id\r
+ response.should be_success \r
+ end\r
+ end\r
+ context 'ユーザだが作家登録していないとき' do\r
+ before do\r
+ @author.destroy\r
+ end\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :show, :id => @panel.id\r
+ response.should be_success \r
+ end\r
+ end\r
=begin\r
context '対象コマがないとき' do\r
context 'html形式' do\r
end\r
end\r
end\r
- context 'ä½\9c家権é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
+ context 'ã\83¦ã\83¼ã\82¶æ¨©é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
before do\r
sign_out @user\r
end\r
end\r
end\r
end\r
+ context 'ユーザ権限はないが管理者権限があるとき' do\r
+ before do\r
+ sign_out @user\r
+ sign_in @admin\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ get :new\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ get :new\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザだが作家登録していないとき' do\r
+ before do\r
+ @author.destroy\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ get :new\r
+ response.status.should eq 302\r
+ end\r
+ it '作家登録ページへ遷移する' do\r
+ get :new\r
+ response.body.should redirect_to new_author_path\r
+ end\r
+ end\r
+ end\r
end\r
\r
describe '新規作成に於いて' do\r
end\r
end\r
end\r
- context 'ä½\9c家権é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
+ context 'ã\83¦ã\83¼ã\82¶æ¨©é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
before do\r
sign_out @user\r
end\r
end\r
end\r
end\r
+ context 'ユーザ権限はないが管理者権限があるとき' do\r
+ before do\r
+ sign_out @user\r
+ sign_in @admin\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ post :create, :panel => @attr\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ post :create, :panel => @attr\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザだが作家登録していないとき' do\r
+ before do\r
+ @author.destroy\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ post :create, :panel => @attr\r
+ response.status.should eq 302\r
+ end\r
+ it '作家登録ページへ遷移する' do\r
+ post :create, :panel => @attr\r
+ response.body.should redirect_to new_author_path\r
+ end\r
+ end\r
+ end\r
context '検証、保存に失敗した' do\r
before do\r
Panel.any_instance.stub(:store).and_return(false)\r
end\r
end\r
end\r
- context 'ä½\9c家権é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
+ context 'ã\83¦ã\83¼ã\82¶æ¨©é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
before do\r
sign_out @user\r
end\r
end\r
end\r
end\r
+ context 'ユーザ権限はないが管理者権限があるとき' do\r
+ before do\r
+ sign_out @user\r
+ sign_in @admin\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ get :edit, :id => @panel.id\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ get :edit, :id => @panel.id\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザだが作家登録していないとき' do\r
+ before do\r
+ @author.destroy\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ get :edit, :id => @panel.id\r
+ response.status.should eq 302\r
+ end\r
+ it '作家登録ページへ遷移する' do\r
+ get :edit, :id => @panel.id\r
+ response.body.should redirect_to new_author_path\r
+ end\r
+ end\r
+ end\r
end\r
\r
describe '更新に於いて' do\r
end\r
end\r
end\r
- context 'ä½\9c家権é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
+ context 'ã\83¦ã\83¼ã\82¶æ¨©é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
before do\r
sign_out @user\r
end\r
end\r
end\r
end\r
+ context 'ユーザ権限はないが管理者権限があるとき' do\r
+ before do\r
+ sign_out @user\r
+ sign_in @admin\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ put :update, :id => @panel.id, :panel => @attr\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ put :update, :id => @panel.id, :panel => @attr\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザだが作家登録していないとき' do\r
+ before do\r
+ @author.destroy\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ put :update, :id => @panel.id, :panel => @attr\r
+ response.status.should eq 302\r
+ end\r
+ it '作家登録ページへ遷移する' do\r
+ put :update, :id => @panel.id, :panel => @attr\r
+ response.body.should redirect_to new_author_path\r
+ end\r
+ end\r
+ end\r
context '検証、保存に失敗した' do\r
before do\r
Panel.any_instance.stub(:store).and_return(false)\r
end\r
end\r
end\r
- context 'ä½\9c家権é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
+ context 'ã\83¦ã\83¼ã\82¶æ¨©é\99\90ã\81\8cã\81ªã\81\84ã\81¨ã\81\8d' do\r
before do\r
sign_out @user\r
end\r
end\r
end\r
end\r
+ context 'ユーザ権限はないが管理者権限があるとき' do\r
+ before do\r
+ sign_out @user\r
+ sign_in @admin\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ delete :destroy, :id => @panel.id\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ delete :destroy, :id => @panel.id\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザだが作家登録していないとき' do\r
+ before do\r
+ @author.destroy\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ delete :destroy, :id => @panel.id\r
+ response.status.should eq 302\r
+ end\r
+ it '作家登録ページへ遷移する' do\r
+ delete :destroy, :id => @panel.id\r
+ response.body.should redirect_to new_author_path\r
+ end\r
+ end\r
+ end\r
context '削除に失敗したとき' do\r
before do\r
Panel.any_instance.stub(:destroy_with_elements).and_return(false)\r
=end\r
end\r
\r
+else\r
+ describe '一覧表示に於いて' do\r
+ before do\r
+ @panel = FactoryGirl.create :panel, :author_id => @author.id\r
+ Panel.stub(:list).and_return([@panel, @panel, @panel])\r
+ sign_in @user\r
+ end\r
+ context 'つつがなく終わるとき' do\r
+ context 'html形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :index\r
+ response.should be_success \r
+ end\r
+ it 'indexテンプレートを描画する' do\r
+ get :index\r
+ response.should render_template("index")\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :index, :format => :json\r
+ response.should be_success \r
+ end\r
+ it 'jsonデータを返す' do\r
+ get :index, :format => :json\r
+ lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザ権限がないとき' do\r
+ before do\r
+ sign_out @user\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :index\r
+ response.should be_success \r
+ end\r
+ it 'indexテンプレートを描画する' do\r
+ get :index\r
+ response.should render_template("index")\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :index, :format => :json\r
+ response.should be_success \r
+ end\r
+ it 'jsonデータを返す' do\r
+ get :index, :format => :json\r
+ lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe '単体表示に於いて' do\r
+ before do\r
+ @panel = FactoryGirl.create :panel, :author_id => @user.author.id\r
+ Panel.stub(:show).with(@panel.id.to_s, [nil, nil]).and_return(@panel)\r
+ Panel.stub(:show).with(@panel.id.to_s, [@user, nil]).and_return(@panel)\r
+ Panel.stub(:show).with(@panel.id.to_s, [nil, @admin]).and_return(@panel)\r
+ sign_in @user\r
+ end\r
+ context 'つつがなく終わるとき' do\r
+ context 'html形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :show, :id => @panel.id\r
+ response.should be_success\r
+ end\r
+ it 'showテンプレートを描画する' do\r
+ get :show, :id => @panel.id\r
+ response.should render_template("show")\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :show, :id => @panel.id, :format => :json\r
+ response.should be_success\r
+ end\r
+ it 'jsonデータを返す' do\r
+ get :show, :id => @panel.id, :format => :json\r
+ lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザ権限がないとき' do\r
+ before do\r
+ sign_out @user\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :show, :id => @panel.id\r
+ response.should be_success\r
+ end\r
+ it 'showテンプレートを描画する' do\r
+ get :show, :id => @panel.id\r
+ response.should render_template("show")\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :show, :id => @panel.id, :format => :json\r
+ response.should be_success\r
+ end\r
+ it 'jsonデータを返す' do\r
+ get :show, :id => @panel.id, :format => :json\r
+ lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'コマ数取得に於いて' do\r
+ before do\r
+ Panel.should_receive(:visible_count).and_return(3)\r
+# sign_in @user\r
+ end\r
+ context 'つつがなく終わるとき' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :count, :format => :json\r
+ response.should be_success \r
+ end\r
+ context 'json形式' do\r
+ it 'jsonデータを返す' do\r
+ get :count, :format => :json\r
+ lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe '新規作成フォーム表示に於いて' do\r
+ before do\r
+ sign_in @user\r
+ end\r
+ context 'つつがなく終わるとき' do\r
+ context 'html形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :new\r
+ response.should be_success \r
+ end\r
+ it 'newテンプレートを描画する' do\r
+ get :new\r
+ response.should render_template("new")\r
+ end\r
+ end\r
+ context 'js形式' do\r
+ it 'new.jsテンプレートを描画する' do\r
+ get :new, :format => :js\r
+ response.should render_template("new")\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'jsonデータを返す' do\r
+ get :new, :format => :json\r
+ lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザ権限がないとき' do\r
+ before do\r
+ sign_out @user\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ get :new\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ get :new\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ context 'js形式' do\r
+ it 'ステータスコード401 Unauthorizedを返す' do\r
+ get :new, :format => :js\r
+ response.status.should eq 401\r
+ end\r
+ it '応答メッセージにUnauthorizedを返す' do\r
+ get :new, :format => :js\r
+ response.message.should match(/Unauthorized/)\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe '新規作成に於いて' do\r
+ before do\r
+ @panel = FactoryGirl.build :panel, :author_id => @author.id\r
+ @attr = FactoryGirl.attributes_for(:panel, :author_id => @author.id)\r
+ sign_in @user\r
+ end\r
+ context 'つつがなく終わるとき' do\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ Panel.any_instance.stub(:store).and_return(true)\r
+ post :create, :panel => @attr\r
+ response.status.should eq 302\r
+ end\r
+ it '作成されたコマの表示ページへ遷移する' do\r
+# Panel.any_instance.stub(:store).and_return(true)\r
+ post :create, :panel => @attr\r
+ response.should redirect_to(Panel.last)\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+# Panel.any_instance.stub(:store).and_return(true)\r
+ post :create, :panel => @attr, :format => :json\r
+ response.should be_success \r
+ end\r
+ it '作成されたコマをjsonデータで返す' do\r
+ post :create, :panel => @attr, :format => :json\r
+ lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザ権限がないとき' do\r
+ before do\r
+ sign_out @user\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ post :create, :panel => @attr\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ post :create, :panel => @attr\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード401 Unauthorizedを返す' do\r
+ post :create, :panel => @attr, :format => :json\r
+ response.status.should eq 401\r
+ end\r
+ it '応答メッセージにUnauthorizedを返す' do\r
+ post :create, :panel => @attr, :format => :json\r
+ response.message.should match(/Unauthorized/)\r
+ end\r
+ end\r
+ end\r
+ end\r
+\r
+ describe '編集フォーム表示に於いて' do\r
+ before do\r
+ @panel = FactoryGirl.create :panel, :author_id => @author.id\r
+ sign_in @user\r
+ Panel.stub(:show).and_return(@panel)\r
+ end\r
+ context 'つつがなく終わるとき' do\r
+ context 'html形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :edit, :id => @panel.id\r
+ response.should be_success \r
+ end\r
+ it 'editテンプレートを描画する' do\r
+ get :edit, :id => @panel.id\r
+ response.should render_template("edit")\r
+ end\r
+ end\r
+ context 'js形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ get :edit, :id => @panel.id, :format => :js\r
+ response.should be_success \r
+ end\r
+ it 'edit.jsテンプレートを描画する' do\r
+ get :edit, :id => @panel.id, :format => :js\r
+ response.should render_template("edit")\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザ権限がないとき' do\r
+ before do\r
+ sign_out @user\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ get :edit, :id => @panel.id\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ get :edit, :id => @panel.id\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ context 'js形式' do\r
+ it 'ステータスコード401 Unauthorizedを返す' do\r
+ get :edit, :id => @panel.id, :format => :js\r
+ response.status.should eq 401\r
+ end\r
+ it '応答メッセージにUnauthorizedを返す' do\r
+ get :edit, :id => @panel.id, :format => :js\r
+ response.message.should match(/Unauthorized/)\r
+ end\r
+ end\r
+ end\r
+ end\r
+\r
+ describe '更新に於いて' do\r
+ before do\r
+ @panel = FactoryGirl.create :panel, :author_id => @user.author.id\r
+ @attr = FactoryGirl.attributes_for(:panel, :author_id => @author.id)\r
+ sign_in @user\r
+ end\r
+ context 'つつがなく終わるとき' do\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ Panel.any_instance.stub(:store).and_return(true)\r
+ put :update, :id => @panel.id, :panel => @attr\r
+ response.status.should eq 302\r
+ end\r
+ it '作成されたコマの表示ページへ遷移する' do\r
+# Panel.any_instance.stub(:store).and_return(true)\r
+ put :update, :id => @panel.id, :panel => @attr\r
+ response.should redirect_to(Panel.last)\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+# Panel.any_instance.stub(:store).and_return(true)\r
+ put :update, :id => @panel.id, :panel => @attr, :format => :json\r
+ response.should be_success \r
+ end\r
+ it 'ページ本体は特に返さない' do\r
+ Panel.any_instance.stub(:save).with(any_args()).and_return(true)\r
+ put :update, :id => @panel.id, :panel => @attr, :format => :json\r
+ response.body.should match /./\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザ権限がないとき' do\r
+ before do\r
+ sign_out @user\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ put :update, :id => @panel.id, :panel => @attr\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ put :update, :id => @panel.id, :panel => @attr\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード401 Unauthorizedを返す' do\r
+ put :update, :id => @panel.id, :panel => @attr, :format => :json\r
+ response.status.should eq 401\r
+ end\r
+ it '応答メッセージにUnauthorizedを返す' do\r
+ put :update, :id => @panel.id, :panel => @attr, :format => :json\r
+ response.message.should match(/Unauthorized/)\r
+ end\r
+ end\r
+ end\r
+ end\r
+\r
+ describe '削除に於いて' do\r
+ before do\r
+ @panel = FactoryGirl.create :panel, :author_id => @user.author.id\r
+ Panel.stub(:edit).and_return(@panel)\r
+ sign_in @user\r
+ end\r
+ context 'つつがなく終わるとき' do\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ delete :destroy, :id => @panel.id\r
+ response.status.should eq 302\r
+ end\r
+ it 'マイコマ一覧ページへ遷移する' do\r
+ delete :destroy, :id => @panel.id\r
+ response.should redirect_to('/home/panel')\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード200 OKを返す' do\r
+ delete :destroy, :id => @panel.id, :format => :json\r
+ response.should be_success\r
+ end\r
+ end\r
+ end\r
+ context 'ユーザ権限がないとき' do\r
+ before do\r
+ sign_out @user\r
+ end\r
+ context 'html形式' do\r
+ it 'ステータスコード302 Foundを返す' do\r
+ delete :destroy, :id => @panel.id\r
+ response.status.should eq 302\r
+ end\r
+ it 'サインインページへ遷移する' do\r
+ delete :destroy, :id => @panel.id\r
+ response.body.should redirect_to '/users/sign_in'\r
+ end\r
+ end\r
+ context 'json形式' do\r
+ it 'ステータスコード401 Unauthorizedを返す' do\r
+ delete :destroy, :id => @panel.id, :format => :json\r
+ response.status.should eq 401\r
+ end\r
+ it '応答メッセージにUnauthorizedを返す' do\r
+ delete :destroy, :id => @panel.id, :format => :json\r
+ response.message.should match(/Unauthorized/)\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+end\r
end\r
\r