Sha256: c2d625f1fa320023ecf3629314ac7deaa33c0baf0cec885272042bb694d535f4

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe "Micropost pages" do

  subject { page }

  it { pending("Micropost, waiting revision") }

=begin
  let(:user) { FactoryGirl.create(:user) }
  
  before do
     able(user,'read', 'user')
     sign_out
     sign_in user
  end
  


  describe "micropost creation" do
    before { visit root_path }

    describe "with invalid information" do

      it "should not create a micropost" do
        expect { click_button "Post" }.to_not change(Micropost, :count)
      end

      describe "error messages" do
        before { click_button "Post" }
        it { should have_content('error') } 
      end
    end

    describe "with valid information" do

      before { fill_in 'micropost_content', with: "Lorem ipsum" }
      it "should create a micropost" do
        expect { click_button "Post" }.to change(Micropost, :count).by(1)
      end
    end
  end

  describe "micropost destruction" do
    before { FactoryGirl.create(:micropost, user: user) }

    describe "as correct user" do
      before { visit root_path }

      it "should delete a micropost" do
        expect { click_link "delete" }.to change(Micropost, :count).by(-1)
      end
    end
  end
=end


end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
guara-0.0.3 spec/requests/micropost_pages_spec.rb
guara-0.0.1.rc spec/requests/micropost_pages_spec.rb