Hi i am testing email through rspec but some problem occured. This is the whole scenario: What i want to do is when my user is created it should send mail to for activation. This is the code under user_spec.rb require File.expand_path(File.dirname(__FILE__) + ‘/../spec_helper’)
def valid_user_attributes { :email => “test...@joshsoftware.com”, :login => “test”, :password => “test123″, :password_confirmation => “test123″, :role_id => 1 } end describe User do before(:each) do @user = User.create ActionMailer::Base.delivery_method = :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] end fixtures :users context “User” do it “should be create if all the credentials are provided” do @user.attributes = valid_user_attributes mail = Notifier.signup_notification(”user_1″) ActionMailer::Base.deliveries.size.should == 1 mail.body.should =~ /Please signup/ @user.should be_valid @user.save end Under notifier.rb it contains: class Notifier < ActionMailer::Base helper :application #user notification def signup_notification( user ) setup_email( user.email ) @subject = "Please signup" @body[:user] = user end end Now here Notifier is another model which contains signup_ notification method. Is it the case that i would need to test that in notifier spec or is it possible to get notifier model in user like by using include method I tried using include like "include Notifier" but is is showing me error as user_spec.rb:2:in `include': wrong argument type Class (expected Module) (TypeError) -- Posted via http://www.ruby-forum.com/. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users