Displaying 2 results from an estimated 2 matches for "as_new_record".
2011 Jun 29
6
RSpec with Rails 3.1rc4: spec test won't recognize <%= %> (should be simple)
In my user_sessions_controller:
class UserSessionsController < ApplicationController
before_filter :require_no_user, :only => [:create, :new]
before_filter :require_user, :only => :destroy
def new
@user_session = UserSession.new
@message = "Hello."
end
def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
2012 Jan 15
2
DEPRECATION WARNING: Passing a template handler in the template name is deprecated. (rspec + haml)
....rb
1 require ''spec_helper''
2
3 describe "contacts/new.html.haml" do
4 before(:each) do
5 assign(:contact, stub_model(Contact,
6 :email => "MyString",
7 :person_id => 1
8 ).as_new_record)
9 end
10
11 it "renders new contact form" do
12 render ####### this render seems to trigger it
13
14 # Run the generator again with the --webrat flag if you want
to use webrat matchers
15 assert_select "form", :action...