Sha256: 999a74dab8f1b40b945f04a98b611525fd103918db56ba6ae5563b1563f0d5b9

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

Feature: Capture and save emails generated in rspec test
  Background:
    Given I successfully run `bundle exec rails new testapp --skip-bundle --skip-sprockets --skip-javascript`
    And I cd to "testapp"
    And I add "rspec-rails" as a dependency
    And I add "factory_girl_rails" as a dependency
    And I add "freezing_email" from this project as a dependency
    And I successfully run `bundle install`
    And I successfully run `bundle exec rails g rspec:install`
    And I successfully run `bundle exec rails g controller password_resets new --no-test-framework`
    And I successfully run `bundle exec rails g mailer user_mailer password_reset`
    And I successfully run `bundle exec rails g model user email:string password_hash:string password_salt:string password_reset_token:string password_reset_sent_at:date`
    And I successfully run `bundle exec rake db:migrate RAILS_ENV=test`

  @disable-bundler
  Scenario: Unsng FreezingEmail to capture emails in rspec test
    When I write to "spec/mailers/user_mailer_spec.rb" with:
      """
      require 'spec_helper'

      describe UserMailer do
        describe "password_reset" do
          include FreezingEmail::Rspec 

          let(:user) { FactoryGirl.create(:user, :password_reset_token => "anything") }
          let(:mail) { UserMailer.password_reset }

          it "send user password reset url" do
            mail.subject.should eq("Password reset")
            mail.deliver
          end
        end
      end
      """
    When I successfully run `bundle exec rspec`
    Then the output should contain "2 examples, 0 failures, 1 pending"
    Then a file named "freezed_emails/password_resets.yml" should exist

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
freezing_email-0.0.2 features/rspec_integration.feature