現在のパスをテストして、オンになっていることを確認しようとしていpost_path(post)
ます。テストに合格するはずです。しかし、私は得てgot: #<Capybara::Session> (using ==)
います。私はこれが何であるかを本当に理解していません。
これはテストコードです
require 'spec_helper'
describe PostsController do
subject { page }
let(:first_user_is_admin) { FactoryGirl.create(:user) }
describe "Not signed in user cannot see any kind of edit view for a post:" do
describe "Post is anonymous without user_id" do
let(:post) {FactoryGirl.create(:anonymous_post)}
before do
visit edit_post_path(post)
end
it { should == post_path(post) }
end
end
end
これがテスト結果です。
1) PostsController Not signed in user cannot see any kind of edit view for a post: Post is anonymous without user_id
Failure/Error: it { should == post_path(post) }
expected: "/posts/1"
got: #<Capybara::Session> (using ==)
Diff:
@@ -1,2 +1,2 @@
-"/posts/1"
+#<Capybara::Session>