1
0

scenario_imports_controller_spec.rb 720 B

1234567891011121314151617181920212223242526
  1. require 'spec_helper'
  2. describe ScenarioImportsController do
  3. before do
  4. sign_in users(:bob)
  5. end
  6. describe "GET new" do
  7. it "initializes a new ScenarioImport and renders new" do
  8. get :new
  9. assigns(:scenario_import).should be_a(ScenarioImport)
  10. response.should render_template(:new)
  11. end
  12. end
  13. describe "POST create" do
  14. it "initializes a ScenarioImport for current_user, passing in params" do
  15. post :create, :scenario_import => { :url => "bad url" }
  16. assigns(:scenario_import).user.should == users(:bob)
  17. assigns(:scenario_import).url.should == "bad url"
  18. assigns(:scenario_import).should_not be_valid
  19. response.should render_template(:new)
  20. end
  21. end
  22. end