Guest User

Untitled

a guest
Jun 22nd, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. ## console
  2.  
  3. [dfr@beta bigmac.git]$ ps -e | grep mong
  4. [dfr@beta bigmac.git]$ ls tmp/pids/
  5. [dfr@beta bigmac.git]$ rcuke features/blog/posts.feature -s "Should be able to create a post with a newly created category"
  6. Feature: Creating posts
  7. In order to provide basic blog functionality, admin users should be able to add and edit blog posts.
  8.  
  9. Background: # features/blog/posts.feature:4
  10. Given admin@example.com is an admin with password "secret" # features/step_definitions/user_steps.rb:1
  11. ==> Waiting for rails application server on port 4567... Ready!
  12. Given I log in as admin@example.com with password "secret" # features/step_definitions/user_steps.rb:9
  13. Connection refused - connect(2) (Errno::ECONNREFUSED)
  14. /usr/local/lib/ruby/1.8/net/http.rb:560:in `initialize'
  15. /usr/local/lib/ruby/1.8/net/http.rb:560:in `open'
  16. /usr/local/lib/ruby/1.8/net/http.rb:560:in `original_net_http_connect'
  17. /usr/local/lib/ruby/1.8/timeout.rb:62:in `timeout'
  18. /usr/local/lib/ruby/1.8/timeout.rb:93:in `timeout'
  19. /usr/local/lib/ruby/1.8/net/http.rb:560:in `original_net_http_connect'
  20. /usr/local/lib/ruby/1.8/net/http.rb:845:in `post'
  21. /usr/local/lib/ruby/1.8/timeout.rb:62:in `timeout'
  22. /usr/local/lib/ruby/1.8/timeout.rb:93:in `timeout'
  23. (eval):2:in `/^I log in as (\S+) with password "([^"]+)"$/'
  24. features/blog/posts.feature:6:in `Given I log in as admin@example.com with password "secret"'
  25.  
  26. Scenario: Should be able to create a post with a newly created category # features/blog/posts.feature:16
  27. Given I am creating a blog post # features/step_definitions/blog_steps.rb:16
  28. When I fill in "blog_post_title" with "Awesome post" # features/step_definitions/webrat_steps.rb:22
  29. And I fill in "blog_post_body" with "This is an awesome post!!!" # features/step_definitions/webrat_steps.rb:22
  30. And I click "Add category" # features/step_definitions/webrat_steps.rb:18
  31. And I fill in "category_name" with "Greatest posts ever" # features/step_definitions/webrat_steps.rb:22
  32. And I press "Add" # features/step_definitions/webrat_steps.rb:14
  33. And I press "Done" # features/step_definitions/webrat_steps.rb:14
  34. Then I should see Awesome post blog post # features/step_definitions/blog_steps.rb:21
  35. And blog category "Greated posts ever" should exist # features/blog/posts.feature:25
  36. And blog post "Awesome post" should belong to "Greated posts ever" category # features/blog/posts.feature:26
  37.  
  38. 1 scenario
  39. 1 failed step
  40. 8 skipped steps
  41. 2 undefined steps
  42. 1 passed step
  43.  
  44. You can implement step definitions for missing steps with these snippets:
  45.  
  46. Then /^blog category "([^\"]*)" should exist$/ do |arg1|
  47. pending
  48. end
  49.  
  50. Then /^blog post "([^\"]*)" should belong to "([^\"]*)" category$/ do |arg1, arg2|
  51. pending
  52. end
  53.  
  54. !!! PID file /home/dfr/webitects/bigmac.git/tmp/pids/mongrel_selenium.pid does not exist. Not running?
  55. mongrel::stop reported an error. Use mongrel_rails mongrel::stop -h to get help.
  56. [dfr@beta bigmac.git]$
  57.  
  58. ## features/support/env.rb
  59.  
  60. # Sets up the Rails environment for Cucumber
  61. ENV["RAILS_ENV"] ||= "test"
  62. require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
  63. require 'cucumber/rails/world'
  64. require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
  65. Cucumber::Rails.use_transactional_fixtures
  66. Cucumber::Rails.bypass_rescue # Comment out this line if you want Rails own error handling
  67. # (e.g. rescue_action_in_public / rescue_responses / rescue_from)
  68.  
  69. require 'webrat'
  70.  
  71. Webrat.configure do |config|
  72. config.mode = :selenium
  73. config.application_address = '10.2.148.109'
  74. config.application_port = 4567
  75.  
  76. config.selenium_server_address = '10.2.148.109'
  77. end
  78.  
  79. # require 'cucumber/rails/rspec'
  80. require 'webrat/core/matchers'
  81.  
  82. require 'test/test_helper'
Add Comment
Please, Sign In to add comment