Created
July 19, 2012 09:06
-
-
Save clivemurray/3142184 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe 'jobs/preview.html.haml' do | |
| before do | |
| assigns[:job] = job | |
| render | |
| end | |
| context "unapproved job" do | |
| let(:job) { Factory.build(:job, :approved => false) } | |
| it "tells us job is not approved" do | |
| response.should have_selector('div#flash-info') do |scope| | |
| scope.inner_text.should match /pending/ | |
| end | |
| end | |
| end | |
| context "approved job" do | |
| let(:job) { Factory.build(:job, :approved => true) } | |
| it "tells us us job is approved" do | |
| response.should have_selector('div#flash-info') do |scope| | |
| scope.inner_text.should match /approved/ | |
| end | |
| end | |
| it "renders a job id" do | |
| job_presenter.should_receive(:job_id).and_return('1234') | |
| render | |
| response.should contain('1234') | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment