Sha256: 6afd3ae50d7b37d1f63a55efdfcc123437080aef58c9c8370d6db7b5af5c9008

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 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 to show action when model is valid" do
    <%= class_name %>.any_instance.stubs(:valid?).returns(true)
    put :update, :id => <%= class_name %>.first
    response.should redirect_to(<%= item_path_for_spec('url') %>)
  end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
bpokosh-nifty-generators-0.1.3 rails_generators/nifty_scaffold/templates/action_specs/update.rb
ryanb-nifty-generators-0.1.3 rails_generators/nifty_scaffold/templates/action_specs/update.rb