rspec - response.should be_success - 看看为什么会失败的任何原因?

时间:2011-03-19 23:32:58

标签: ruby-on-rails ruby-on-rails-3 rspec rspec2

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

我很难过。不知道如何调试这个?感谢

0 个答案:

没有答案