Sha256: 3ca5a9c5ab4b5e239eb28ba29e70ea224e72a51b6c7efa97cd4e428697f12917

Contents?: true

Size: 425 Bytes

Versions: 2

Compression:

Stored size: 425 Bytes

Contents

  it "create action should render new template when model is invalid" do
    ActiveRecord::Errors.any_instance.stubs(:empty?).returns(false)
    post :create
    response.should render_template(:new)
  end
  
  it "create action should redirect when model is valid" do
    ActiveRecord::Errors.any_instance.stubs(:empty?).returns(true)
    post :create
    response.should redirect_to(<%= item_path_for_spec('url') %>)
  end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
linki-nifty-generators-0.3.1 rails_generators/nifty_scaffold/templates/tests/rspec/actions/create.rb
linki-nifty_generators-0.3.1 rails_generators/nifty_scaffold/templates/tests/rspec/actions/create.rb