Sha256: 610b9d712298d8f25f7a02c89f68bf109297691728880cbb6ef17fd9525aa0d3

Contents?: true

Size: 501 Bytes

Versions: 3

Compression:

Stored size: 501 Bytes

Contents

  describe :update do
    it "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 "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(<%= item_path_for_spec('url') %>)
    end
  end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stager-0.2.2 lib/generators/stager/controller/templates/spec/actions/update.rb
stager-0.2.1 lib/generators/stager/controller/templates/spec/actions/update.rb
stager-0.2.0 lib/generators/stager/controller/templates/spec/actions/update.rb