Sha256: 7f18e1ff5e4178df6c3fe0fcbabfb21efe8ac82eabf9ae5d4c4d1e5104c39b0d

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe <%= user_plural_class_name %>Controller do
  fixtures :all
  render_views

  it "new action should render new template" do
    get :new
    response.should render_template(:new)
  end

  it "create action should render new template when model is invalid" do
    <%= user_class_name %>.any_instance.stubs(:valid?).returns(false)
    post :create
    response.should render_template(:new)
  end

  it "create action should redirect when model is valid" do
    <%= user_class_name %>.any_instance.stubs(:valid?).returns(true)
    post :create
    response.should redirect_to("/")
  <%- unless options[:authlogic] -%>
    session['<%= user_singular_name %>_id'].should == assigns['<%= user_singular_name %>'].id
  <%- end -%>
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nifty-generators-0.4.1 lib/generators/nifty/authentication/templates/tests/rspec/users_controller.rb