Skip to content

Instantly share code, notes, and snippets.

@clivemurray
Created July 19, 2012 09:06
Show Gist options
  • Select an option

  • Save clivemurray/3142184 to your computer and use it in GitHub Desktop.

Select an option

Save clivemurray/3142184 to your computer and use it in GitHub Desktop.
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