Sha256: 73e2589508d214d841ca40f17b55f6eab884500b663793765f90a76b3e6cbc50

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

require 'spec_helper'

describe 'Contact info' do
  
  describe 'GET /contact' do
    
    before(:each) do
          @plan = Factory.build(:plan, :name => "Gold", :price => 20)
          @contact_info = Factory.build(:contact_info)
          @credit_card = Factory.build(:credit_card)
          @subscription = Factory.build(:subscription, :contact_info => @contact_info, :plan => @plan, :credit_card => @credit_card)
          @user = Factory.create(:user, :subscription => @subscription)
       end
       
       it 'should display contact form' do
         visit edit_subscription_contact_info_path
         page.should have_content 'Update Billing Contact Info'
       end
    
  end
  
   describe 'POST /contact-info' do
     before(:each) do
       @plan = Factory.build(:plan, :name => "Gold", :price => 20)
       @contact_info = Factory.build(:contact_info)

       @credit_card = Factory.build(:credit_card)
       @subscription = Factory.build(:subscription, :contact_info => @contact_info, :plan => @plan, :credit_card => @credit_card)
       @user = Factory.create(:user, :subscription => @subscription)
     end
     
     it 'should update contact info' do
       visit edit_subscription_contact_info_path
       fill_in "First name", :with => "Ted"
       click_on("Update Contact Info")
       page.should have_content("Contact info was successfully updated.")
       page.should have_content("Ted")
     end
   end
   
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saasaparilla-0.2.2 spec/requests/contact_info_controller_spec.rb
saasaparilla-0.2.1 spec/requests/contact_info_controller_spec.rb
saasaparilla-0.1.8 spec/requests/contact_info_controller_spec.rb
saasaparilla-0.1.7 spec/requests/contact_info_controller_spec.rb
saasaparilla-0.1.6 spec/requests/contact_info_controller_spec.rb