Sha256: e5a67ca07bfc98198c8687896ced18f9cf80f438ec7ed3a7bd2692c7ed8de174

Contents?: true

Size: 834 Bytes

Versions: 2

Compression:

Stored size: 834 Bytes

Contents

  describe "the destroy action" do

    before :each do
      @<%= singular_name %> = mock_record <%= class_name %>, :destroy => true
    end

    context "in html format" do

      before :each do
        delete :destroy, :id => @<%= singular_name %>.to_param
      end

      it { should respond_with(:redirect) }
      it { should redirect_to(<%= plural_name %>_url) }
      it { should assign_to(:<%= singular_name %>).with(@<%= singular_name %>) }
      it { should_not set_the_flash }

    end

    context "in xml format" do

      before :each do
        delete :destroy, :id => @<%= singular_name %>.to_param, :format => "xml"
      end

      it { should respond_with_content_type(:xml) }
      it { should respond_with(:ok) }
      it { should assign_to(:<%= singular_name %>).with(@<%= singular_name %>) }

    end

  end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iain-pizza-generators-0.1.3 rails_generators/pizza_scaffold/templates/tests/rspec/actions/destroy.rb
iain-pizza-generators-0.1.4 rails_generators/pizza_scaffold/templates/tests/rspec/actions/destroy.rb