Sha256: 65743d6ed42e5ab8ea5a7289d87a38c6078951a6e4e39c393f149ec2e3a0f97e

Contents?: true

Size: 1.15 KB

Versions: 23

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

module Writefully
  describe PostsController do 
    routes { Writefully::Engine.routes }

    fixtures :"writefully/sites"
    fixtures :"writefully/posts"
    fixtures :"writefully/authorships"

    let(:owner)  { writefully_authorships(:wf_owner_1) }
    let(:site)   { writefully_sites(:codemy_net) }
    let(:post_1) {  writefully_posts(:hash_selector_pattern) }

    let(:some_post) { writefully_posts(:blah_post) }

    before do 
      session[:wf_authorship_id] = owner.id
    end

    describe "#index" do 
      it "should be success" do 
        get :index, site_id: site.slug
        response.should be_success
      end

      it "should assign correct posts" do 
        get :index, site_id: site.slug
        assigns[:posts].should include post_1
        assigns[:posts].should_not include some_post
      end
    end

    describe "#show" do 
      it "should be success" do 
        get :show, site_id: site.slug, id: post_1.id
        response.should be_success
      end

      it "should assign the correct post" do 
        get :show, site_id: site.slug, id: post_1.id
        assigns[:post].should eq post_1
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
writefully-0.7.1 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.12 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.11 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.10 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.9 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.7 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.6 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.5 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.4 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.3 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.6.2 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.5.1 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.5.0 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.4.10 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.4.8 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.4.7 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.4.6 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.4.5 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.4.4 spec/controllers/writefully/posts_controller_spec.rb
writefully-0.4.2 spec/controllers/writefully/posts_controller_spec.rb