Sha256: ab699e2c66834198d8974476e0998ccc42767ca07e91f3bb3a3a9c5da4e5b73d

Contents?: true

Size: 484 Bytes

Versions: 1

Compression:

Stored size: 484 Bytes

Contents

  it "update action should render edit template when model is invalid" do
    <%= class_name %>.any_instance.stubs(:valid?).returns(false)
    put :update, :id => <%= class_name %>.first
    response.should render_template(:edit)
  end
  
  it "update action should redirect when model is valid" do
    <%= class_name %>.any_instance.stubs(:valid?).returns(true)
    put :update, :id => <%= class_name %>.first
    response.should redirect_to(<%= items_path_for_spec('url') %>)
  end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ghart-nifty-generators-0.3.0.1 rails_generators/nifty_admin_scaffold/templates/tests/rspec/actions/update.rb