Guest User

Untitled

a guest
Jun 28th, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.59 KB | None | 0 0
  1. AnswersController
  2. POST #create
  3. with valid attributes
  4. saves the new answer in the database
  5. renders create template
  6. associates new answer with user created it
  7. with invalid attributes
  8. does not save the question
  9. re-renders create template
  10. unathorized user tries to create answer
  11. redirects to sign-in view
  12. PATCH #update
  13. assigns the requested answer to @answer
  14. assigns the question
  15. author of the answer tries to update the answer
  16. changes answer attributes
  17. render update template
  18. Different user question
  19. current user tries to update it (FAILED - 1)
  20. DELETE #destroy
  21. delete own answer
  22. delete answer
  23. render destroy template
  24. delete not yours answer
  25. delete answer
  26. PUT #choose_best
  27. assigns the answer to @answer
  28. author chooses the best answer (FAILED - 2)
  29. another user chooses the best answer
  30. behaves like rated
  31. POST #vote_up
  32. user votes two times
  33. user votes for someone else's model
  34. user votes for his model
  35. POST #vote_down
  36. user votes two times
  37. user votes for someone else's model
  38. user votes for his model
  39. POST #reset_vote
  40. user resets his vote
  41.  
  42. AttachmentsController
  43. DELETE #destroy
  44. User tries to delete his own attachment
  45. deletes the attachment
  46. render destroy template
  47. User tries to delete not his attachment
  48. delete attachment (FAILED - 3)
  49. redirect to attachment view
  50.  
  51. CommentsController
  52. POST #create
  53. with valid attributes
  54. stores comment in DB
  55. associates comment with the user
  56. renders create teamplate
  57. with invalid parameters
  58. comment does not save
  59. renders create teamplate
  60.  
  61. OmniauthCallbacksController
  62. vk
  63. redirects to root_path (FAILED - 4)
  64. returns User (FAILED - 5)
  65. twitter
  66. redirects to root_path (FAILED - 6)
  67. returns User (FAILED - 7)
  68.  
  69. QuestionsController
  70. GET #index
  71. populates an array of all questions
  72. renders index view
  73. GET #show
  74. assigns the requested question to @question
  75. renders show view
  76. assigns a new Answer to @answer
  77. GET #new
  78. assigns a new Question to @question
  79. renders new view
  80. POST #create
  81. with valid attributes
  82. associates new question with user created it
  83. redirects to show view
  84. with invalid attributes
  85. does not save the question
  86. re-renders new view
  87. unathorized user tries to create answer
  88. redirects to sign-in view
  89. DELETE #destroy
  90. delete own question
  91. delete question
  92. redirect to index view
  93. delete not yours question
  94. delete question
  95. PATCH #update
  96. assigns the requested question to @question
  97. changes question attributes
  98. render update template
  99. Other user
  100. tries to edit someone else's question
  101. redirects to question (FAILED - 8)
  102. behaves like rated
  103. POST #vote_up
  104. user votes two times
  105. user votes for someone else's model
  106. user votes for his model
  107. POST #vote_down
  108. user votes two times
  109. user votes for someone else's model
  110. user votes for his model
  111. POST #reset_vote
  112. user resets his vote
  113.  
  114. UsersController
  115. GET #setup_email
  116. temp email
  117. renders setup_email (FAILED - 9)
  118. check email
  119. redirects to root with non temp email
  120. POST #confirm_email
  121. temp email
  122. changes user email (FAILED - 10)
  123. renders setup_email (FAILED - 11)
  124. check email
  125. redirects to verify user
  126.  
  127. Failures:
  128.  
  129. 1) AnswersController PATCH #update Different user question current user tries to update it
  130. Failure/Error: expect(flash[:alert]).to eq "You can not update other users' answers"
  131.  
  132. expected: "You can not update other users' answers"
  133. got: nil
  134.  
  135. (compared using ==)
  136. # ./spec/controllers/answers_controller_spec.rb:74:in `block (4 levels) in <top (required)>'
  137.  
  138. 2) AnswersController PUT #choose_best author chooses the best answer
  139. Failure/Error: expect(answer).to be_best
  140. expected `#<Answer id: 156, body: "Answer body", question_id: 239, created_at: "2018-06-27 14:23:04", updated_at: "2018-06-27 14:23:04", user_id: 399, best: false>.best?` to return true, got false
  141. # ./spec/controllers/answers_controller_spec.rb:118:in `block (3 levels) in <top (required)>'
  142.  
  143. 3) AttachmentsController DELETE #destroy User tries to delete not his attachment delete attachment
  144. Failure/Error: expect { delete :destroy, params: { id: attachment_2 }, format: :js }.to_not change(Attachment, :count)
  145. expected #count not to have changed, but did change from 2 to 1
  146. # ./spec/controllers/attachments_controller_spec.rb:25:in `block (4 levels) in <main>'
  147.  
  148. 4) OmniauthCallbacksController vk redirects to root_path
  149. Failure/Error: get :vkontakte
  150.  
  151. CanCan::AuthorizationNotPerformed:
  152. This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
  153. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
  154. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
  155. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
  156. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
  157. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
  158. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
  159. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
  160. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
  161. # ./spec/controllers/omniauth_callbacks_controller_spec.rb:11:in `block (3 levels) in <main>'
  162.  
  163. 5) OmniauthCallbacksController vk returns User
  164. Failure/Error: get :vkontakte
  165.  
  166. CanCan::AuthorizationNotPerformed:
  167. This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
  168. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
  169. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
  170. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
  171. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
  172. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
  173. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
  174. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
  175. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
  176. # ./spec/controllers/omniauth_callbacks_controller_spec.rb:11:in `block (3 levels) in <main>'
  177.  
  178. 6) OmniauthCallbacksController twitter redirects to root_path
  179. Failure/Error: get :twitter
  180.  
  181. CanCan::AuthorizationNotPerformed:
  182. This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
  183. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
  184. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
  185. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
  186. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
  187. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
  188. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
  189. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
  190. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
  191. # ./spec/controllers/omniauth_callbacks_controller_spec.rb:26:in `block (3 levels) in <main>'
  192.  
  193. 7) OmniauthCallbacksController twitter returns User
  194. Failure/Error: get :twitter
  195.  
  196. CanCan::AuthorizationNotPerformed:
  197. This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
  198. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
  199. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
  200. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
  201. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
  202. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
  203. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
  204. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
  205. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
  206. # ./spec/controllers/omniauth_callbacks_controller_spec.rb:26:in `block (3 levels) in <main>'
  207.  
  208. 8) QuestionsController PATCH #update Other user redirects to question
  209. Failure/Error: expect(response).to redirect_to question_2
  210.  
  211. Expected response to be a <200: ok>, but was a <403: Forbidden>
  212. Response body: .
  213. Expected: 200
  214. Actual: 403
  215. # ./spec/controllers/questions_controller_spec.rb:142:in `block (4 levels) in <main>'
  216.  
  217. 9) UsersController GET #setup_email temp email renders setup_email
  218. Failure/Error: before { get :setup_email, params: { id: @user } }
  219.  
  220. CanCan::AuthorizationNotPerformed:
  221. This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
  222. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
  223. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
  224. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
  225. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
  226. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
  227. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
  228. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
  229. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
  230. # ./spec/controllers/users_controller_spec.rb:7:in `block (4 levels) in <main>'
  231.  
  232. 10) UsersController POST #confirm_email temp email changes user email
  233. Failure/Error: patch :confirm_email, params: { id: @user, user: { email: 'user@email.com'} }
  234.  
  235. CanCan::AuthorizationNotPerformed:
  236. This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
  237. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
  238. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
  239. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
  240. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
  241. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
  242. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
  243. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
  244. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
  245. # ./spec/controllers/users_controller_spec.rb:29:in `block (4 levels) in <main>'
  246.  
  247. 11) UsersController POST #confirm_email temp email renders setup_email
  248. Failure/Error: patch :confirm_email, params: { id: @user, user: { email: 'user@email.com'} }
  249.  
  250. CanCan::AuthorizationNotPerformed:
  251. This action failed the check_authorization because it does not authorize_resource. Add skip_authorization_check to bypass this check.
  252. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/cancancan-2.2.0/lib/cancan/controller_additions.rb:263:in `block in check_authorization'
  253. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/template_assertions.rb:61:in `process'
  254. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `block in process'
  255. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `catch'
  256. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:102:in `_catch_warden'
  257. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/devise-4.4.3/lib/devise/test/controller_helpers.rb:35:in `process'
  258. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/gon-6.2.0/lib/gon/spec_helpers.rb:15:in `process'
  259. # /Users/olegakunin/.rvm/gems/ruby-2.5.0@qna/gems/rails-controller-testing-1.0.2/lib/rails/controller/testing/integration.rb:12:in `block (2 levels) in <module:Integration>'
  260. # ./spec/controllers/users_controller_spec.rb:36:in `block (4 levels) in <main>'
  261.  
  262. Finished in 1.91 seconds (files took 1.29 seconds to load)
  263. 69 examples, 11 failures
  264.  
  265. Failed examples:
  266.  
  267. rspec ./spec/controllers/answers_controller_spec.rb:72 # AnswersController PATCH #update Different user question current user tries to update it
  268. rspec ./spec/controllers/answers_controller_spec.rb:114 # AnswersController PUT #choose_best author chooses the best answer
  269. rspec ./spec/controllers/attachments_controller_spec.rb:24 # AttachmentsController DELETE #destroy User tries to delete not his attachment delete attachment
  270. rspec ./spec/controllers/omniauth_callbacks_controller_spec.rb:14 # OmniauthCallbacksController vk redirects to root_path
  271. rspec ./spec/controllers/omniauth_callbacks_controller_spec.rb:18 # OmniauthCallbacksController vk returns User
  272. rspec ./spec/controllers/omniauth_callbacks_controller_spec.rb:29 # OmniauthCallbacksController twitter redirects to root_path
  273. rspec ./spec/controllers/omniauth_callbacks_controller_spec.rb:33 # OmniauthCallbacksController twitter returns User
  274. rspec ./spec/controllers/questions_controller_spec.rb:139 # QuestionsController PATCH #update Other user redirects to question
  275. rspec ./spec/controllers/users_controller_spec.rb:9 # UsersController GET #setup_email temp email renders setup_email
  276. rspec ./spec/controllers/users_controller_spec.rb:28 # UsersController POST #confirm_email temp email changes user email
  277. rspec ./spec/controllers/users_controller_spec.rb:35 # UsersController POST #confirm_email temp email renders setup_email
Add Comment
Please, Sign In to add comment