summaryrefslogtreecommitdiff
path: root/lib/generators/nifty/scaffold/templates/tests/rspec/actions/create.rb
blob: ef5a906bd52c87ffcbf241484a7a1da8d6e3b820 (plain)
1
2
3
4
5
6
7
8
9
10
11
  it "create action should render new template when model is invalid" do
    <%= class_name %>.any_instance.stubs(:valid?).returns(false)
    post :create
    response.should render_template(:new)
  end

  it "create action should redirect when model is valid" do
    <%= class_name %>.any_instance.stubs(:valid?).returns(true)
    post :create
    response.should redirect_to(<%= item_path_for_spec('url') %>)
  end