Skip to content

Commit

Permalink
Feature for archives
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviershay committed Nov 7, 2008
1 parent 524e187 commit 8ef0075
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions features/browsing.feature
Expand Up @@ -8,3 +8,9 @@ Feature: Browsing
When I go to the home page
Then I should see "This is a post"
And I should see a link to all posts tagged "awesome"

Scenario: browsing the archive, to find more content to read
Given there is at least one post titled "My Post"
When I go to the home page
And I follow "Archives"
Then I should see "My Post"
4 changes: 4 additions & 0 deletions features/steps/browsing.rb
Expand Up @@ -2,6 +2,10 @@
Factory(:post, :tags => [Factory(:tag, :name => tag_name)])
end

Given /there is at least one post titled "([\w\s]+)"/ do |title|
Factory(:post, :title => title)
end

Then /I should see a link to all posts tagged "([\w\s]+)"/ do |tag_name|
# TODO: Use an xpath matcher rather than regex
response.body.should =~ %r{<a href="/#{tag_name}">awesome</a>}
Expand Down
2 changes: 0 additions & 2 deletions features/steps/factories.rb
Expand Up @@ -12,6 +12,4 @@
a.published_at Time.now
a.created_at Time.now
a.updated_at Time.now

a.tags {|t| t.association(:tags) }
end

0 comments on commit 8ef0075

Please sign in to comment.