Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. /Users/tiwa/.rvm/rubies/ruby-2.2.3/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/tiwa/RubymineProjects/serverapp/bin/spring rails test
  2. Testing started at 21:04 ...
  3. Started
  4.  
  5.  
  6. Minitest::Assertion: "Task.count" didn't change by 1.
  7. Expected: 3
  8. Actual: 2
  9. test/controllers/tasks_controller_test.rb:19:in `block in <class:TasksControllerTest>'
  10.  
  11. Minitest::Assertion: "TaskType.count" didn't change by 1.
  12. Expected: 3
  13. Actual: 2
  14. test/controllers/task_types_controller_test.rb:19:in `block in <class:TaskTypesControllerTest>'
  15. Finished in 1.48352s
  16. 15 tests, 17 assertions, 2 failures, 0 errors, 0 skips
  17. Running via Spring preloader in process 11821
  18.  
  19. Process finished with exit code 0
  20.  
  21. one:
  22. name: MyString
  23. executable_path: MyString
  24. start_time: 2015-07-27 16:03:37
  25. end_time: 2015-07-27 16:03:37
  26. scheduled_days: MyString
  27. agent: MyString
  28. agent_key: MyString
  29.  
  30. two:
  31. name: MyString
  32. executable_path: MyString
  33. start_time: 2015-07-27 16:03:37
  34. end_time: 2015-07-27 16:03:37
  35. scheduled_days: MyString
  36. agent: MyString
  37. agent_key: MyString
  38.  
  39. one:
  40. name: MyString
  41. description: MyString
  42.  
  43. two:
  44. name: MyString
  45. description: MyString
  46.  
  47. ActiveRecord::Schema.define(version: 20161208141728) do
  48.  
  49. create_table "task_types", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
  50. t.string "name"
  51. t.string "description"
  52. t.datetime "created_at", null: false
  53. t.datetime "updated_at", null: false
  54. end
  55.  
  56. create_table "tasks", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
  57. t.string "name"
  58. t.string "executable_path"
  59. t.datetime "start_time"
  60. t.datetime "end_time"
  61. t.string "scheduled_days"
  62. t.string "agent"
  63. t.string "agent_key"
  64. t.datetime "created_at", null: false
  65. t.datetime "updated_at", null: false
  66. end
  67.  
  68. end
  69.  
  70. # POST /tasks
  71. # POST /tasks.json
  72. def create
  73. @task = Task.new(task_params)
  74.  
  75. respond_to do |format|
  76. if @task.save
  77. format.html { redirect_to @task, notice: 'Task was successfully created.' }
  78. format.json { render :show, status: :created, location: @task }
  79. else
  80. format.html { render :new }
  81. format.json { render json: @task.errors, status: :unprocessable_entity }
  82. end
  83. end
  84. end
  85.  
  86. def create
  87. @task_type = TaskType.new(task_type_params)
  88.  
  89. respond_to do |format|
  90. if @task_type.save
  91. format.html { redirect_to @task_type, notice: 'Task type was successfully created.' }
  92. format.json { render :show, status: :created, location: @task_type }
  93. else
  94. format.html { render :new }
  95. format.json { render json: @task_type.errors, status: :unprocessable_entity }
  96. end
  97. end
  98. end
  99.  
  100. # task_controller_test.rb
  101. test "should create task" do
  102. assert_difference('Task.count') do
  103. post tasks_url, params: { task: { agent: @task.agent, end_time: @task.end_time, executable_path: @task.executable_path, name: @task.name, scheduled_days: @task.scheduled_days, start_time: @task.start_time } }
  104. end
  105.  
  106. assert_redirected_to task_url(Task.last)
  107. end
  108.  
  109.  
  110. # task_types_controller_test.rb
  111. test "should create task_type" do
  112. assert_difference('TaskType.count') do
  113. post task_types_url, params: { task_type: { } }
  114. end
  115.  
  116. assert_redirected_to task_type_url(TaskType.last)
  117. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement