Skip to content
No description or website provided.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
Gemfile Initial version May 17, 2012
README.md
Rakefile
jasper-rails-rspec.gemspec

README.md

jasper-rails-rspec

jasper-rails and RSpec integration. It just defines a new RSpec matcher called "contain".

Dependencies

jasper-rails rspec-rails pdf-inspector

Install

gem install jasper-rails-rspec

Configure

Add jasper-rails-rspec to your Gemfile:

  gem "jasper-rails-rspec"

Using jasper-rails-rspec

require 'spec_helper'

describe PeopleController do
    describe "GET listagem" do
    before do
      Person.stub(:all).and_return([Person.new(:name=>'jonh', :email=>'lennon@beatles.com'), Person.new(:name=>'paul', :email=>'paul@beatles.com')])
    end

    it "be success" do
      response.should be_success
    end

    it "should not contain nulls" do
      get :index, :format => :pdf
      response.should_not contain("null")
    end

    it "should contain emails" do
      get :index, :format => :pdf
      response.should contain("lennon@beatles.com")
      response.should contain("paul@beatles.com")
    end
    end
end

DEMO

Check out jasper-rails-demo for a running example.

Something went wrong with that request. Please try again.