spec/controllers/naf/applications_controller_spec.rb in naf-1.1.4 vs spec/controllers/naf/applications_controller_spec.rb in naf-2.0.0

- old
+ new

@@ -63,11 +63,12 @@ response.should render_template("naf/applications/new") response.should be_success end context "on the create action" do - let(:valid_app) { mock_model(Application, save: true, application_schedule: nil, id: 5) } - let(:invalid_app) { mock_model(Application, save: false) } + let(:application_schedule) { mock_model(ApplicationSchedule, application_run_group_name: 'command', prerequisites: []) } + let(:valid_app) { mock_model(Application, save: true, id: 5, update_attributes: true, application_schedule: application_schedule) } + let(:invalid_app) { mock_model(Application, save: false, update_attributes: false, application_schedule: application_schedule) } it "should redirect to show when valid" do Application.should_receive(:new).and_return(valid_app) post :create, application: {} response.should redirect_to(application_path(valid_app.id))