Sha256: 274a6451d6cd35fa9fa118d3e5544a94d97b3acab1a9245bce4b26807a30f105

Contents?: true

Size: 1.31 KB

Versions: 12

Compression:

Stored size: 1.31 KB

Contents

# encoding: utf-8

require "spec_helper"

feature "User visits a blog post" do
  
  it "has the title" do
    post = create(:post, published_at: Time.now)
    
    visit blogelator.post_path(post)
    
    page.should have_content "My First Blog Post"
  end
  
  it "has the body text" do
    post = create(:post, published_at: Time.now)
    
    visit blogelator.post_path(post)
    
    page.should have_content "paragraph with some bold text."
  end
  
  it "has a link to the next and previous post" do
    random_post = create(:post, title: "Random Post", published_at: Time.now - 12.days)
    random_post = create(:post, title: "Random Post", published_at: Time.now + 2.days)
    previous_post = create(:post, title: "Previous Post", published_at: Time.now - 10.days)
    post = create(:post, published_at: Time.now, published_at: Time.now - 5.days)
    next_post = create(:post, title: "Next Post", published_at: Time.now, published_at: Time.now)
    
    visit blogelator.post_path(post)
    
    page.should have_content previous_post.title
    page.should have_content next_post.title
    
    click_link("Previous Post")
    current_path.should eq(blogelator.post_path(previous_post))
    
    visit blogelator.post_path(post)
    
    click_link("Next Post")
    current_path.should eq(blogelator.post_path(next_post))
  end
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
blogelator-0.2.5 spec/features/user_visits_blog_post_spec.rb
blogelator-0.2.4 spec/features/user_visits_blog_post_spec.rb
blogelator-0.2.3 spec/features/user_visits_blog_post_spec.rb
blogelator-0.2.2 spec/features/user_visits_blog_post_spec.rb
blogelator-0.2.1 spec/features/user_visits_blog_post_spec.rb
blogelator-0.1.6 spec/features/user_visits_blog_post_spec.rb
blogelator-0.1.5 spec/features/user_visits_blog_post_spec.rb
blogelator-0.1.4 spec/features/user_visits_blog_post_spec.rb
blogelator-0.1.3 spec/features/user_visits_blog_post_spec.rb
blogelator-0.1.2 spec/features/user_visits_blog_post_spec.rb
blogelator-0.1.1 spec/features/user_visits_blog_post_spec.rb
blogelator-0.1.0 spec/features/user_visits_blog_post_spec.rb