Skip to content

ElamT/jasper-rails-rspec

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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=>'[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

DEMO

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%