Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper.rb'
- describe "Phone call", :search => true do
- it "should be created without user logged in" do
- email_sent_until_now = email_count
- item = RareBook.last
- visit send("new_rare_book_phone_call_path", :title => item.to_url_param, :id => item.id)
- fill_in "phone_call_name", :with => "User name"
- fill_in "phone_call_phone_number", :with => "1234567890"
- select "tra_un_ora", :from => "phone_call_availability"
- click_button "phone_call_submit"
- page.should have_content I18n.t('phone_calls.created')
- email_count.should eq(email_sent_until_now + 1)
- last_email.should have_content "User name"
- last_email.should have_content "1234567890"
- last_email.should have_content item.title
- last_email.should_not have_content "UTENTE REGISTRATO CON ID"
- end
- it "should be created with user logged in" do
- d Buyer.all
- user = Buyer.first
- login_user(user.username, user.username)
- save_and_open_page
- email_sent_until_now = email_count
- item = RareBook.last
- visit send("new_rare_book_phone_call_path", :title => item.to_url_param, :id => item.id)
- fill_in "phone_call_name", :with => "User name"
- fill_in "phone_call_phone_number", :with => "1234567890"
- select "tra_un_ora", :from => "phone_call_availability"
- click_button "phone_call_submit"
- page.should have_content I18n.t('phone_calls.created')
- email_count.should eq(email_sent_until_now + 1)
- last_email.should have_content "User name"
- last_email.should have_content "1234567890"
- last_email.should have_content item.title
- last_email.should have_content "UTENTE REGISTRATO CON ID"
- last_email.should have_content user.id
- logout_user
- end
- end
Add Comment
Please, Sign In to add comment