jasper-rails and RSpec integration. It just defines a new RSpec matcher called "contain".
jasper-rails rspec-rails pdf-inspector
gem install jasper-rails-rspec
Add jasper-rails-rspec
to your Gemfile:
gem "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=>'[email protected]'), Person.new(:name=>'paul', :email=>'[email protected]')])
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("[email protected]")
response.should contain("[email protected]")
end
end
end
Check out jasper-rails-demo for a running example.