No commit activity in last 3 years
No release in over 3 years
Defines matchers for testing PDFs generated by jasper-rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.1.1
>= 2.8.0
>= 2.8.0
 Project Readme

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.