incoming_mails_controller.rb:
require 'spec_helper'
describe IncomingMailsController do
include Devise::TestHelpers
before do
@user = Factory(:user)
sign_in @user
end
it "should create a new IncomingMail record in the db" do
post :create, :from => 'x@x.com', :to => 'x@x.net', :cc => 'dad@as.net', :subject => 'The subject', :message_text => 'the text msg', :message_html => 'the html version'
response.should be_success
end
end
incoming_mails_controller.rb
class IncomingMailsController < ApplicationController
skip_before_filter :verify_authenticity_token
def create
render :text => "Mail Accepted", :status => 200
end
end
我很难过。不知道如何调试这个?感谢