1 # -*- encoding: utf-8 -*-
5 describe ArtistsController do
7 @admin = FactoryGirl.create :admin
8 @demand_user = FactoryGirl.create :demand_user
9 @sp = FactoryGirl.create :system_picture
10 @lg = FactoryGirl.create :license_group
11 @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
12 @user = FactoryGirl.create( :user_yas)
13 @author = FactoryGirl.create :author, :user_id => @user.id
14 @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
17 if MagicNumber['run_mode'] == 1
18 describe '一覧表示に於いて' do
20 Artist.stub(:list).and_return([@artist, @artist, @artist])
24 it '与えられたpageがセットされている' do
25 get :index, :page => 5
26 assigns(:page).should eq 5
28 it '省略されると@pageに1値が入る' do
30 assigns(:page).should eq 1
32 it '与えられたpage_sizeがセットされている' do
33 get :index, :page_size => 15
34 assigns(:page_size).should eq 15
36 it '省略されると@page_sizeにデフォルト値が入る' do
38 assigns(:page_size).should eq Artist.default_page_size
40 it '最大を超えると@page_sizeにデフォルト最大値が入る' do
41 get :index, :page_size => 1500
42 assigns(:page_size).should eq Artist.max_page_size
44 it '不正な値が入ると@page_sizeにデフォルト最大値が入る' do
45 get :index, :page_size => 0
46 assigns(:page_size).should eq Artist.default_page_size
49 context 'つつがなく終わるとき' do
50 it 'ステータスコード200 OKを返す' do
52 response.should be_success
54 it '絵師モデルに一覧を問い合わせている' do
55 Artist.should_receive(:list).exactly(1)
58 it '@artistsにリストを取得している' do
60 assigns(:artists).should have_at_least(3).items
63 it 'indexテンプレートを描画する' do
65 response.should render_template("index")
70 get :index, :format => :json
71 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
73 it '絵師モデルにjson一覧出力オプションを問い合わせている' do
74 Artist.should_receive(:list_json_opt).exactly(1)
75 get :index, :format => :json
77 it 'データがリスト構造になっている' do
78 get :index, :format => :json
79 json = JSON.parse response.body
80 json.should have_at_least(3).items
82 it 'リストの先頭くらいは絵師っぽいものであって欲しい' do
83 get :index, :format => :json
84 json = JSON.parse response.body
85 json.first.has_key?("name").should be_true
89 context 'ユーザ権限がないとき' do
94 it 'ステータスコード302 Foundを返す' do
96 response.status.should eq 302
100 response.should redirect_to '/users/sign_in'
104 it 'ステータスコード401 Unauthorizedを返す' do
105 get :index, :format => :json
106 response.status.should eq 401
108 it '応答メッセージにUnauthorizedを返す' do
109 get :index, :format => :json
110 response.message.should match(/Unauthorized/)
114 context 'ユーザ権限はないが管理者権限があるとき' do
119 it 'ステータスコード200 OKを返す' do
121 response.should be_success
124 context 'ユーザ権限はないが借手権限があるとき' do
129 it 'ステータスコード200 OKを返す' do
131 response.should be_success
134 context 'ユーザだが作家登録していないとき' do
138 it 'ステータスコード200 OKを返す' do
140 response.should be_success
147 Artist.stub(:show).and_return(@artist)
150 context 'つつがなく終わるとき' do
151 it 'ステータスコード200 OKを返す' do
152 get :show, :id => @artist.id
153 response.should be_success
155 it '絵師モデルに単体取得を問い合わせている' do
156 Artist.should_receive(:show).exactly(1)
159 it '@arにアレを取得している' do
160 get :show, :id => @artist.id
161 assigns(:ar).should eq(@artist)
164 it 'showテンプレートを描画する' do
165 get :show, :id => @artist.id
166 response.should render_template("show")
171 get :show, :id => @artist.id, :format => :json
172 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
174 it '絵師モデルにjson単体出力オプションを問い合わせている' do
175 Artist.should_receive(:show_json_opt).exactly(1)
176 get :show, :id => @artist.id, :format => :json
179 get :show, :id => @artist.id, :format => :json
180 json = JSON.parse response.body
181 json["name"].should match(/yas/)
185 context 'ユーザ権限がないとき' do
190 it 'ステータスコード302 Foundを返す' do
191 get :show, :id => @artist.id
192 response.status.should eq 302
194 it 'サインインページへ遷移する' do
195 get :show, :id => @artist.id
196 response.body.should redirect_to '/users/sign_in'
200 it 'ステータスコード401 Unauthorizedを返す' do
201 get :show, :id => @artist.id, :format => :json
202 response.status.should eq 401
204 it '応答メッセージにUnauthorizedを返す' do
205 get :show, :id => @artist.id, :format => :json
206 response.message.should match(/Unauthorized/)
210 context 'ユーザ権限はないが管理者権限があるとき' do
215 it 'ステータスコード200 OKを返す' do
216 get :show, :id => @artist.id
217 response.should be_success
220 context 'ユーザ権限はないが借手権限があるとき' do
225 it 'ステータスコード200 OKを返す' do
226 get :show, :id => @artist.id
227 response.should be_success
230 context 'ユーザだが作家登録していないとき' do
234 it 'ステータスコード200 OKを返す' do
235 get :show, :id => @artist.id
236 response.should be_success
240 context '対象作家がないとき' do
242 it '例外404 not_foundを返す' do
245 }.should raise_error(ActiveRecord::RecordNotFound)
249 it '例外404 not_foundを返す' do
251 get :show, :id => 0, :format => :json
252 }.should raise_error(ActiveRecord::RecordNotFound)
259 describe '絵師数取得に於いて' do
261 Artist.should_receive(:visible_count).and_return(3)
264 context 'つつがなく終わるとき' do
265 it 'ステータスコード200 OKを返す' do
266 get :count, :format => :json
267 response.should be_success
271 get :count, :format => :json
272 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
274 it 'データがHash構造になっていて絵師数が3である' do
275 get :count, :format => :json
276 json = JSON.parse response.body
277 json["count"].should == 3
283 describe '新規作成フォーム表示に於いて' do
287 context 'つつがなく終わるとき' do
288 it 'ステータスコード200 OKを返す' do
290 response.should be_success
292 it '@artistに新規データを用意している' do
294 assigns(:ar).should be_a_new(Artist)
296 it '絵師モデルにデフォルト値補充を依頼している' do
297 Artist.any_instance.should_receive(:supply_default).exactly(1)
301 it 'newテンプレートを描画する' do
303 response.should render_template("new")
307 it 'new.jsテンプレートを描画する' do
308 get :new, :format => :js
309 response.should render_template("new")
314 get :new, :format => :json
315 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
317 it '絵師モデルにjson単体出力オプションを問い合わせている' do
318 Artist.should_receive(:show_json_opt).exactly(1)
319 get :new, :format => :json
323 context 'ユーザ権限がないとき' do
328 it 'ステータスコード302 Foundを返す' do
330 response.status.should eq 302
332 it 'サインインページへ遷移する' do
334 response.body.should redirect_to '/users/sign_in'
338 it 'ステータスコード401 Unauthorizedを返す' do
339 get :new, :format => :js
340 response.status.should eq 401
342 it '応答メッセージにUnauthorizedを返す' do
343 get :new, :format => :js
344 response.message.should match(/Unauthorized/)
348 it 'ステータスコード401 Unauthorizedを返す' do
349 get :new, :format => :json
350 response.status.should eq 401
352 it '応答メッセージにUnauthorizedを返す' do
353 get :new, :format => :json
354 response.message.should match(/Unauthorized/)
358 context 'ユーザ権限はないが管理者権限があるとき' do
364 it 'ステータスコード302 Foundを返す' do
366 response.status.should eq 302
368 it 'サインインページへ遷移する' do
370 response.body.should redirect_to '/users/sign_in'
374 context 'ユーザだが作家登録していないとき' do
379 it 'ステータスコード302 Foundを返す' do
381 response.status.should eq 302
385 response.body.should redirect_to new_author_path
391 describe '新規作成に於いて' do
394 @attr = FactoryGirl.attributes_for(:artist, :author_id => @author.id, :name => 'ken')
396 context '事前チェックしておく' do
397 it '絵師モデルにデフォルト値補充を依頼している' do
398 Artist.any_instance.should_receive(:supply_default).exactly(1)
399 post :create, :artist => @attr
401 it '絵師モデルにカラム値復元を依頼している' do
402 Artist.any_instance.should_receive(:attributes=).exactly(1)
403 post :create, :artist => @attr
405 it '絵師モデルに上書き補充を依頼している' do
406 Artist.any_instance.should_receive(:overwrite).exactly(1)
407 post :create, :artist => @attr
410 Artist.any_instance.should_receive(:save).exactly(1)
411 post :create, :artist => @attr
414 context 'つつがなく終わるとき' do
415 it "@arに作成された絵師を保持していて、それがDBにある" do
416 post :create, :artist => @attr
417 assigns(:ar).should be_a(Artist)
418 assigns(:ar).should be_persisted
421 it 'ステータスコード302 Foundを返す' do
422 Artist.any_instance.stub(:save).and_return(true)
423 post :create, :artist => @attr
424 response.status.should eq 302
427 # Artist.any_instance.stub(:save).and_return(true)
428 post :create, :artist => @attr
429 response.should redirect_to(root_path)
433 it 'ステータスコード200 OKを返す' do
434 # Artist.any_instance.stub(:save).and_return(true)
435 post :create, :artist => @attr, :format => :json
436 response.should be_success
438 it '作成された絵師をjsonデータで返す' do
439 post :create, :artist => @attr, :format => :json
440 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
442 it '絵師モデルにjson単体出力オプションを問い合わせている' do
443 Artist.should_receive(:show_json_opt).exactly(1)
444 post :create, :artist => @attr, :format => :json
447 post :create, :artist => @attr, :format => :json
448 json = JSON.parse response.body
449 json["name"].should match(/ken/)
453 context 'ユーザ権限がないとき' do
458 it 'ステータスコード302 Foundを返す' do
459 post :create, :artist => @attr
460 response.status.should eq 302
462 it 'サインインページへ遷移する' do
463 post :create, :artist => @attr
464 response.body.should redirect_to '/users/sign_in'
468 it 'ステータスコード401 Unauthorizedを返す' do
469 post :create, :artist => @attr, :format => :json
470 response.status.should eq 401
472 it '応答メッセージにUnauthorizedを返す' do
473 post :create, :artist => @attr, :format => :json
474 response.message.should match(/Unauthorized/)
478 context 'ユーザ権限はないが管理者権限があるとき' do
484 it 'ステータスコード302 Foundを返す' do
485 post :create, :artist => @attr
486 response.status.should eq 302
488 it 'サインインページへ遷移する' do
489 post :create, :artist => @attr
490 response.body.should redirect_to '/users/sign_in'
494 context 'ユーザだが作家登録していないとき' do
499 it 'ステータスコード302 Foundを返す' do
500 post :create, :artist => @attr
501 response.status.should eq 302
504 post :create, :artist => @attr
505 response.body.should redirect_to new_author_path
509 context '検証、保存に失敗した' do
511 Artist.any_instance.stub(:save).and_return(false)
513 it "未保存の絵師を保持している" do
514 post :create, :artist => @attr
515 assigns(:ar).should be_a_new(Artist)
518 it 'ステータスコード200 OKを返す' do
519 post :create, :artist => @attr
520 response.status.should eq 200
523 post :create, :artist => @attr
524 response.should render_template("new")
528 it 'ステータスコード422 unprocessable_entity を返す' do
529 post :create, :artist => @attr, :format => :json
530 response.status.should eq 422
532 it '応答メッセージUnprocessable Entityを返す' do
533 post :create, :artist => @attr, :format => :json
534 response.message.should match(/Unprocessable/)
540 describe '編集フォーム表示に於いて' do
543 Artist.stub(:edit).and_return(@artist)
545 context 'つつがなく終わるとき' do
546 it 'ステータスコード200 OKを返す' do
547 get :edit, :id => @artist.id
548 response.should be_success
550 it '絵師モデルに編集取得を問い合わせている' do
551 Artist.should_receive(:edit).exactly(1)
552 get :edit, :id => @artist.id
554 it '@artistにデータを用意している' do
555 get :edit, :id => @artist.id
556 assigns(:artist).should eq @artist
559 it 'editテンプレートを描画する' do
560 get :edit, :id => @artist.id
561 response.should render_template("edit")
565 it 'edit.jsテンプレートを描画する' do
566 get :edit, :id => @artist.id, :format => :js
567 response.should render_template("edit")
571 context 'ユーザ権限がないとき' do
576 it 'ステータスコード302 Foundを返す' do
577 get :edit, :id => @artist.id
578 response.status.should eq 302
580 it 'サインインページへ遷移する' do
581 get :edit, :id => @artist.id
582 response.body.should redirect_to '/users/sign_in'
586 it 'ステータスコード401 Unauthorizedを返す' do
587 get :edit, :id => @artist.id, :format => :js
588 response.status.should eq 401
590 it '応答メッセージにUnauthorizedを返す' do
591 get :edit, :id => @artist.id, :format => :js
592 response.message.should match(/Unauthorized/)
596 context 'ユーザ権限はないが管理者権限があるとき' do
602 it 'ステータスコード302 Foundを返す' do
603 get :edit, :id => @artist.id
604 response.status.should eq 302
606 it 'サインインページへ遷移する' do
607 get :edit, :id => @artist.id
608 response.body.should redirect_to '/users/sign_in'
612 context 'ユーザだが作家登録していないとき' do
617 it 'ステータスコード302 Foundを返す' do
618 get :edit, :id => @artist.id
619 response.status.should eq 302
622 get :edit, :id => @artist.id
623 response.body.should redirect_to new_author_path
631 @attr = FactoryGirl.attributes_for(:artist, :author_id => @author.id, :name => 'ryu')
634 context '事前チェックしておく' do
635 it '絵師モデルに編集取得を問い合わせている' do
636 Artist.stub(:edit).with(any_args()).and_return @artist
637 Artist.should_receive(:edit).exactly(1)
638 put :update, :id => @artist.id, :artist => @attr
640 it '絵師モデルにカラム値復元を依頼している' do
641 Artist.any_instance.should_receive(:attributes=).exactly(1)
642 put :update, :id => @artist.id, :artist => @attr
644 it '絵師モデルに上書き補充を依頼している' do
645 Artist.any_instance.should_receive(:overwrite).exactly(1)
646 put :update, :id => @artist.id, :artist => @attr
649 Artist.any_instance.stub(:save).with(any_args).and_return true
650 Artist.any_instance.should_receive(:save).exactly(1)
651 put :update, :id => @artist.id, :artist => @attr
653 it '@arにアレを取得している' do
654 put :update, :id => @artist.id, :artist => @attr
655 assigns(:ar).should eq @artist
658 context 'つつがなく終わるとき' do
660 put :update, :id => @artist.id, :artist => @attr
661 Artist.find(@artist.id).name.should eq 'ryu'
664 it 'ステータスコード302 Foundを返す' do
665 Artist.any_instance.stub(:save).with(any_args()).and_return(true)
666 put :update, :id => @artist.id, :artist => @attr
667 response.status.should eq 302
670 put :update, :id => @artist.id, :artist => @attr
671 response.should redirect_to('/home/configure')
675 it 'ステータスコード200 OKを返す' do
676 Artist.any_instance.stub(:save).with(any_args()).and_return(true)
677 put :update, :id => @artist.id, :artist => @attr, :format => :json
678 response.should be_success
681 Artist.any_instance.stub(:save).with(any_args()).and_return(true)
682 put :update, :id => @artist.id, :artist => @attr, :format => :json
683 response.body.should match /./
687 context 'ユーザ権限がないとき' do
692 it 'ステータスコード302 Foundを返す' do
693 put :update, :id => @artist.id, :artist => @attr
694 response.status.should eq 302
696 it 'サインインページへ遷移する' do
697 put :update, :id => @artist.id, :artist => @attr
698 response.body.should redirect_to '/users/sign_in'
702 it '応答メッセージにUnauthorizedを返す' do
703 put :update, :id => @artist.id, :artist => @attr, :format => :json
704 response.message.should match(/Unauthorized/)
708 context 'ユーザ権限はないが管理者権限があるとき' do
714 it 'ステータスコード302 Foundを返す' do
715 put :update, :id => @artist.id, :artist => @attr
716 response.status.should eq 302
718 it 'サインインページへ遷移する' do
719 put :update, :id => @artist.id, :artist => @attr
720 response.body.should redirect_to '/users/sign_in'
724 context 'ユーザだが作家登録していないとき' do
729 it 'ステータスコード302 Foundを返す' do
730 put :update, :id => @artist.id, :artist => @attr
731 response.status.should eq 302
734 put :update, :id => @artist.id, :artist => @attr
735 response.body.should redirect_to new_author_path
739 context '検証、保存に失敗したとき' do
741 Artist.any_instance.stub(:save).and_return(false)
744 it 'ステータスコード200 Okを返す' do
745 put :update, :id => @artist.id, :artist => @attr
746 response.status.should eq 200
749 put :update, :id => @artist.id, :artist => @attr
750 response.should render_template("edit")
754 it 'ステータスコード422 unprocessable_entity を返す' do
755 Artist.any_instance.stub(:save).and_return(false)
756 put :update, :id => @artist.id, :artist => @attr, :format => :json
757 response.status.should eq 422
759 it '応答メッセージUnprocessable Entityを返す' do
760 put :update, :id => @artist.id, :artist => @attr, :format => :json
761 response.message.should match(/Unprocessable/)
768 describe '一覧表示に於いて' do
770 Artist.stub(:list).and_return([@artist, @artist, @artist])
773 context 'つつがなく終わるとき' do
774 it 'ステータスコード200 OKを返す' do
776 response.should be_success
779 it 'indexテンプレートを描画する' do
781 response.should render_template("index")
786 get :index, :format => :json
787 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
791 context 'ユーザ権限がないとき' do
795 it 'ステータスコード200 OKを返す' do
797 response.should be_success
800 it 'indexテンプレートを描画する' do
802 response.should render_template("index")
807 get :index, :format => :json
808 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
816 Artist.stub(:show).and_return(@artist)
819 context 'つつがなく終わるとき' do
820 it 'ステータスコード200 OKを返す' do
821 get :show, :id => @artist.id
822 response.should be_success
825 it 'showテンプレートを描画する' do
826 get :show, :id => @artist.id
827 response.should render_template("show")
832 get :show, :id => @artist.id, :format => :json
833 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
837 context 'ユーザ権限がないとき' do
841 it 'ステータスコード200 OKを返す' do
842 get :show, :id => @artist.id
843 response.should be_success
846 it 'showテンプレートを描画する' do
847 get :show, :id => @artist.id
848 response.should render_template("show")
853 get :show, :id => @artist.id, :format => :json
854 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
860 describe '絵師数取得に於いて' do
862 Artist.should_receive(:visible_count).and_return(3)
865 context 'つつがなく終わるとき' do
866 it 'ステータスコード200 OKを返す' do
867 get :count, :format => :json
868 response.should be_success
872 get :count, :format => :json
873 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
879 describe '新規作成フォーム表示に於いて' do
883 context 'つつがなく終わるとき' do
884 it 'ステータスコード200 OKを返す' do
886 response.should be_success
889 it 'newテンプレートを描画する' do
891 response.should render_template("new")
895 it 'new.jsテンプレートを描画する' do
896 get :new, :format => :js
897 response.should render_template("new")
902 get :new, :format => :json
903 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
907 context 'ユーザ権限がないとき' do
912 it 'ステータスコード302 Foundを返す' do
914 response.status.should eq 302
916 it 'サインインページへ遷移する' do
918 response.body.should redirect_to '/users/sign_in'
922 it 'ステータスコード401 Unauthorizedを返す' do
923 get :new, :format => :js
924 response.status.should eq 401
926 it '応答メッセージにUnauthorizedを返す' do
927 get :new, :format => :js
928 response.message.should match(/Unauthorized/)
932 it 'ステータスコード401 Unauthorizedを返す' do
933 get :new, :format => :json
934 response.status.should eq 401
936 it '応答メッセージにUnauthorizedを返す' do
937 get :new, :format => :json
938 response.message.should match(/Unauthorized/)
944 describe '新規作成に於いて' do
947 @attr = FactoryGirl.attributes_for(:artist, :author_id => @author.id, :name => 'ken')
949 context 'つつがなく終わるとき' do
951 it 'ステータスコード302 Foundを返す' do
952 Artist.any_instance.stub(:save).and_return(true)
953 post :create, :artist => @attr
954 response.status.should eq 302
957 # Artist.any_instance.stub(:save).and_return(true)
958 post :create, :artist => @attr
959 response.should redirect_to(root_path)
963 it 'ステータスコード200 OKを返す' do
964 # Artist.any_instance.stub(:save).and_return(true)
965 post :create, :artist => @attr, :format => :json
966 response.should be_success
968 it '作成された絵師をjsonデータで返す' do
969 post :create, :artist => @attr, :format => :json
970 lambda{JSON.parse(response.body)}.should_not raise_error(JSON::ParserError)
974 context 'ユーザ権限がないとき' do
979 it 'ステータスコード302 Foundを返す' do
980 post :create, :artist => @attr
981 response.status.should eq 302
983 it 'サインインページへ遷移する' do
984 post :create, :artist => @attr
985 response.body.should redirect_to '/users/sign_in'
989 it 'ステータスコード401 Unauthorizedを返す' do
990 post :create, :artist => @attr, :format => :json
991 response.status.should eq 401
993 it '応答メッセージにUnauthorizedを返す' do
994 post :create, :artist => @attr, :format => :json
995 response.message.should match(/Unauthorized/)
1001 describe '編集フォーム表示に於いて' do
1004 Artist.stub(:edit).and_return(@artist)
1006 context 'つつがなく終わるとき' do
1007 it 'ステータスコード200 OKを返す' do
1008 get :edit, :id => @artist.id
1009 response.should be_success
1012 it 'editテンプレートを描画する' do
1013 get :edit, :id => @artist.id
1014 response.should render_template("edit")
1018 it 'edit.jsテンプレートを描画する' do
1019 get :edit, :id => @artist.id, :format => :js
1020 response.should render_template("edit")
1024 context 'ユーザ権限がないとき' do
1029 it 'ステータスコード302 Foundを返す' do
1030 get :edit, :id => @artist.id
1031 response.status.should eq 302
1033 it 'サインインページへ遷移する' do
1034 get :edit, :id => @artist.id
1035 response.body.should redirect_to '/users/sign_in'
1039 it 'ステータスコード401 Unauthorizedを返す' do
1040 get :edit, :id => @artist.id, :format => :js
1041 response.status.should eq 401
1043 it '応答メッセージにUnauthorizedを返す' do
1044 get :edit, :id => @artist.id, :format => :js
1045 response.message.should match(/Unauthorized/)
1051 describe '更新に於いて' do
1053 @attr = FactoryGirl.attributes_for(:artist, :author_id => @author.id, :name => 'ryu')
1056 context 'つつがなく終わるとき' do
1058 it 'ステータスコード302 Foundを返す' do
1059 Artist.any_instance.stub(:save).with(any_args()).and_return(true)
1060 put :update, :id => @artist.id, :artist => @attr
1061 response.status.should eq 302
1064 put :update, :id => @artist.id, :artist => @attr
1065 response.should redirect_to('/home/configure')
1069 it 'ステータスコード200 OKを返す' do
1070 Artist.any_instance.stub(:save).with(any_args()).and_return(true)
1071 put :update, :id => @artist.id, :artist => @attr, :format => :json
1072 response.should be_success
1074 it 'ページ本体は特に返さない' do
1075 Artist.any_instance.stub(:save).with(any_args()).and_return(true)
1076 put :update, :id => @artist.id, :artist => @attr, :format => :json
1077 response.body.should match /./
1081 context 'ユーザ権限がないとき' do
1085 it 'ステータスコード302 Foundを返す' do
1086 put :update, :id => @artist.id, :artist => @attr
1087 response.status.should eq 302
1090 it 'サインインページへ遷移する' do
1091 put :update, :id => @artist.id, :artist => @attr
1092 response.body.should redirect_to '/users/sign_in'
1096 it '応答メッセージにUnauthorizedを返す' do
1097 put :update, :id => @artist.id, :artist => @attr, :format => :json
1098 response.message.should match(/Unauthorized/)