Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
ゲスト: テストが通るように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
YOSHIDA Hiroki committed Dec 21, 2013
1 parent e257d59 commit 5af6d27
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions spec/controllers/clips_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

describe "PUT 'create'" do
context "未ログインの場合" do
it "ログインページにリダイレクトすること" do
it "新規登録ページにリダイレクトすること" do
put :reclip, id: clip.id
response.should redirect_to(:new_user_session)
response.should redirect_to(:new_user_registration)
end
end

Expand All @@ -52,9 +52,9 @@
before { clip }

context "未ログインの場合" do
it "ログインページにリダイレクトすること" do
it "新規登録ページにリダイレクトすること" do
put :reclip, id: clip.id
response.should redirect_to(:new_user_session)
response.should redirect_to(:new_user_registration)
end
end

Expand All @@ -69,9 +69,9 @@

describe "PUT 'unreclip'" do
context "未ログインの場合" do
it "ログインページにリダイレクトすること" do
it "新規登録ページにリダイレクトすること" do
put :reclip, id: clip.id
response.should redirect_to(:new_user_session)
response.should redirect_to(:new_user_registration)
end
end

Expand All @@ -86,10 +86,9 @@

describe "XHR-PUT 'reclip'" do
context "未ログインの場合" do
it "ログインページにリダイレクトすること" do
it "新規登録ページにリダイレクトすること" do
xhr :put, :reclip, id: clip.id
response.body.should include('window.location')
response.body.should include(new_user_session_path)
response.header['Location'].should include(new_user_registration_path)
end
end

Expand All @@ -108,10 +107,9 @@

describe "XHR-PUT 'unreclip'" do
context "未ログインの場合" do
it "ログインページにリダイレクトすること" do
it "新規登録ページにリダイレクトすること" do
xhr :put, :unreclip, id: clip.id
response.body.should include('window.location')
response.body.should include(new_user_session_path)
response.header['Location'].should include(new_user_registration_path)
end
end

Expand Down

0 comments on commit 5af6d27

Please sign in to comment.