From d54ff5f34109f8453e9a4e211fb0cbee6fd34233 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Tue, 21 Feb 2012 15:21:50 -0800 Subject: [PATCH] MS; DG added test for unauthenticated post viewing --- features/logged_out_browsing.feature | 4 ++++ features/step_definitions/user_steps.rb | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/features/logged_out_browsing.feature b/features/logged_out_browsing.feature index 1d63e4155..114669ecc 100644 --- a/features/logged_out_browsing.feature +++ b/features/logged_out_browsing.feature @@ -11,3 +11,7 @@ Feature: Browsing Diaspora as a logged out user Scenario: Visiting a profile page When I am on "bob@bob.bob"'s page Then I should see "public stuff" + + Scenario: Visiting a post show page + When I view "bob@bob.bob"'s first post + Then I should see "public stuff" diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 185876afc..8fd3f009a 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -161,3 +161,9 @@ Given /^I have (\d+) contacts$/ do |n| end AspectMembership.import(aspect_memberships) end + +When /^I view "([^\"]*)"'s first post$/ do |email| + user = User.find_by_email(email) + post = user.posts.first + visit post_path(post) +end