I think there is a problem with the screencast today, I don't seem to be able to download or view it. Nobody else has commented, so I thought I better :-)
@Gavin, Yes, me too! Initially I thought it might be a local problem or perhaps i was trying to pull it a bit too soon but it seems like something is missing on Ryan's end.
Great introduction to cucumber! I already knew the framework and noticed, that you're pointing out the power of it very clear. A great starting-point for your audience.
This looks great! One question I had, is this something that can replace shoulda? I know you said to do continue doing unit tests - so is this something I use in combination with shoulda (like your use of rspec)?
Working for me now too. :-) Wow, Cucumber is really impressive, I've been quite intimidated by the various Rails testing methodologies but this seems quite friendly.
In my opinion BDD (using cucumber) is the best way to test a rails application and present the result to a customer (which may not be familiar with programming).
Cracking Screencast this week - but here's a bit of an OT question - in this you're using the Rails bundle for textmate, yet you appear to have different shortcuts to the one I have - for instance forin and field are missing from mine - where did you get yours from?
I've been using Watir (Web Application Testing in Watir) for a while now. I've found that when testing javascript applicaitons, the combination of Cucumber/SafariWatir/Safari4.0 is very fluid and very fast.
Hey, thanks for this Ryan. It's a really great intro to Cuke.
@Rich mentioned using Cuke with Watir. I've seen a bit about this but would love to find out a little more about this and about using Cuke with Selenium.
This is a pretty neat intro to Cuke w/ Watir: http://www.vimeo.com/2871256 but it aint no Railscast!
Great screencast. Just what I need but I'm having problems installing rpsec and rspec-rails. When I install the gems I get: Could not find main page README.rdoc
Cucumber and Webrat installed just fine though. Any ideas? I'm on leopard.
(not related)
I am having issues with a rails app that I am sure is fairly trivial. I generated a generic scaffold, implemented restful_auth per your instructions, and mucked around with the layout. Now I have discovered my named route new_todo_path doesn't work anymore it points to /todo/new which makes the url localhost/todo//todo/new or localhost//todo/new because I had set todo as the root controller in my routing file. Any ideas? All other routes work fine. Another strange thing is if I manually go to localhost/todo/new it creates a record without me even submitting the form.
Ryan, you are a really mean guy, you know? I wanted to use the easter weekend to get forward with my app, but I guess, now I'm gonna play around with cukes all day long. ;)
OK, repeated you tutorial. Just started with Rails and wanted to check out a good TDD scheme for Ruby and found Cucumber & RSpec. The homepages are nice for experts, but not a single step-by-step guide for getting it to work for newbs. Especially the rake commands are given NOWHERE and as a newb the problem with tables reported by Cucumber (if you don't know you need to clone) and the official Cucumber Wiki example actually using a table in the feature got me going crazy... Your railscast on this should become part of the official documentation! Thanks loads, man!!!
I am new to BDD and am trying to figure out when it is that one would use rspec in this process? After the Cucumber features pass? Would rspec just get used for unit testing at that point?
I had trouble installing webrat on ubuntu until I installed the required packages described on this page http://wiki.rubyonrails.org/testing/webrat#installation
If you are new and following along at home with a newer version of Cucumber (I've got 0.3.5), the -n switch for the "cucumber features" command will generate an error. Apparently -n refers to a different option in later versions, and the current equivalent is "--no-source".
Love these testing screencasts, Ryan! They are the only comprehensive source I've seen that walks through using all of the tools together to write tests for and code for a vaguely realistic Rails app, without assuming I am already a testing wizard.
Great introduction to cucumber! I already knew the framework and noticed, that you're pointing out the power of it very clear. A great starting-point for your audience.
I just installed Cucumber and Ruby on Rails on a Fedora 12 virtual machine. I am having the following issue complaining about jopenssl. Any ideas what could be wrong? Thanks
Thanks for the great screencast, Ryan.
Note:
From Cucumber 0.4.5 and onwards you will also need to install the 'cucumber-rails' gem, or else 'script/generate cucumber' will fail.
I used Term for a class name but it seems to be incompatible with Cucumber. Thanks for all the podcasts. http://stackoverflow.com/questions/1736747/how-to-resolve-rails-model-namespace-collision
I'm getting funky error output (not matching yours). cucumber seems to be suppressing the errors? See http://stackoverflow.com/questions/3232856/cucumber-errors-suppressed-not-displayed-fully for full details.
This is horrendous - by the time you had written all the regex's for every bit of your code you could have written tests by hand much quicker. It is like you are making up regex'sa to explain english statements instead of logically doing something - seems really convoluted to me.
Am I not getting something? I was checking all over to see if this was a practical joke or something.
There still seems to be a problem playing this video. It works if you manually skip to a few minutes in but the video freezes up after the intro graphic if you start from 0s. Strangely the audio is fine throughout.
Thanks Ryan and your team. This site is extremely help me to learn new things easy way in ROR. Recently I have started Testing using Cucumber and I tried to install it as you have described.
I am using Rails 3.2
ISSUE: when I try to run rake cucumber I am getting this error:-
Hi Ryan,
I think there is a problem with the screencast today, I don't seem to be able to download or view it. Nobody else has commented, so I thought I better :-)
@Gavin, Yes, me too! Initially I thought it might be a local problem or perhaps i was trying to pull it a bit too soon but it seems like something is missing on Ryan's end.
@Ryan, waiting patiently.
Cheers,
Aditya
same here: 503 Service Unavailable
Yes, I cannot download screencast too...
All screencasts aren't available, looks like the host is down
I'm unable to download the screencasts, too. Seems that the media server is down.
No problems at all here.
Great 'cast Ryan - as a bonus you may want to add a link to Ben Mabey's presentation at MountainWest RubyConf
http://mwrc2009.confreaks.com/14-mar-2009-15-00-bdd-with-cucumber-ben-mabey.html
^^ I like how he breaks everything down
Many thanks Ryan, you're our hero !!!
The problem seems to be solved now. Great screencast, Ryan!
Great introduction to cucumber! I already knew the framework and noticed, that you're pointing out the power of it very clear. A great starting-point for your audience.
Cheers,
Florian
Hey Ryan,
This looks great! One question I had, is this something that can replace shoulda? I know you said to do continue doing unit tests - so is this something I use in combination with shoulda (like your use of rspec)?
Working for me now too. :-) Wow, Cucumber is really impressive, I've been quite intimidated by the various Rails testing methodologies but this seems quite friendly.
Great cast!
Maybe next week you can cover Cucumber with Ajax?
Keep up the good work!
Sorry about the download problems guys. Dreamhost has been a little flaky lately. May be time to find a mirror for when this happens.
@pimpmaster, good idea! I knew I forgot some other resource links. I'll add it.
@Jay, Cucumber is most often used with RSpec, but it isn't tied directly to any testing framework. You can definitely use Shoulda with it instead.
@Anlek, I plan to do more Cucumber testing episodes in the future, but not yet sure on the specific topics. Thanks for the suggestion.
Thanks for the gentle introduction Ryan!
Test::Unit::TestCase ... I mean ActiveSupport::TestCase for life!
Am I the only one who find these testing frameworks extremely annoying?
Cucumber is a similar but improved way of "plain text stories"
http://blog.davidchelimsky.net/articles/2007/10/22/plain-text-stories-on-rails
and also integrates them.
In my opinion BDD (using cucumber) is the best way to test a rails application and present the result to a customer (which may not be familiar with programming).
Very nice screen-cast. I'm hoping to see more BDD screen-casts in the future, especially about Cucumber and RSpec.
Thanks!
Hi Ryan,
Cracking Screencast this week - but here's a bit of an OT question - in this you're using the Rails bundle for textmate, yet you appear to have different shortcuts to the one I have - for instance forin and field are missing from mine - where did you get yours from?
Really good introduction to BDD. I'm gonna show your screencast to the rest of my team since I already wanted to convince them about Cucumber.
Well done again,
and thanks.
Attila
Great tutorial! Thanks for your work.
Thank you for this useful and timely cast.
I'd like to see one about RSpec replacing Test::Unit.
That is so cool, Ryan! Just again when I needed an introduction to cucumber you come around with another screencast (was similar back with Liquid)!
All praise our mighty voice from beyond! ;)
Thanks, Ryan. Terrific intro that really helped me begin to wrap my head around Cucumber.
Seems like a great way to build a rock solid Rails apps from the bottom-up.
As always, superlative work.
Very interesting. Keep it up Ryan. Can you please make a screen cast on Globalize 2.
I've been using Watir (Web Application Testing in Watir) for a while now. I've found that when testing javascript applicaitons, the combination of Cucumber/SafariWatir/Safari4.0 is very fluid and very fast.
@Neil, you can find those shortcuts in my textmate bundle.
http://github.com/ryanb/ryan-on-rails.tmbundle/
Markus:
Or Outside-In as we say in BDD land :-)
Well done!
Awesome! as always... thank you very much!
Hey, thanks for this Ryan. It's a really great intro to Cuke.
@Rich mentioned using Cuke with Watir. I've seen a bit about this but would love to find out a little more about this and about using Cuke with Selenium.
This is a pretty neat intro to Cuke w/ Watir: http://www.vimeo.com/2871256 but it aint no Railscast!
Awesome! I've tried cucumber and it's great!
Hi Ryan, if using cucumber, why we are still using RSPEC?
Great screencast. Just what I need but I'm having problems installing rpsec and rspec-rails. When I install the gems I get: Could not find main page README.rdoc
Cucumber and Webrat installed just fine though. Any ideas? I'm on leopard.
Hi Ryan,
I was just wondering how you would go about defining a resource route using the paths case statement.
For example:
When I go to Bitstar Media's project Computer Science show page
http://pastie.org/437618
I am having alot of trouble getting this type of functionality with Cucumber. Any tips?
(not related)
I am having issues with a rails app that I am sure is fairly trivial. I generated a generic scaffold, implemented restful_auth per your instructions, and mucked around with the layout. Now I have discovered my named route new_todo_path doesn't work anymore it points to /todo/new which makes the url localhost/todo//todo/new or localhost//todo/new because I had set todo as the root controller in my routing file. Any ideas? All other routes work fine. Another strange thing is if I manually go to localhost/todo/new it creates a record without me even submitting the form.
Disregard the part about the model I think I have fixed that
Hey, great episode! I definitely have to try BDD with cucumber.
I have setup Cucumber as outlined in the Railscast. Cucumber on a Windows Vista System console does not show correct (ansi escape coded) colors.
How to setup Windows Vista Home Premium w Rails 2.3, cucumber, rspec,
rspec-rails, webrat for proper Cucumber console colors.
Superb intro to Cucumber. Many thanks.
Ken Wagner
@Kenneth:
Try to use this tutorial to install Cygwin as a Unix-like terminal:
Cygwin Info: http://en.wikipedia.org/wiki/Cygwin
Tutorial for rails: http://phaseshiftllc.com/archives/2008/10/02/setting-up-rails-on-windows-with-cygwin
- Florian
I just installed all this and the default webrat file was missing the go to method (amongst others). Also didn't have the routes file, either.
I lifted them from your git repository and then webrat started complaining that it wasn't configured properly and needed
Webrat.configure do |config|
config.mode = :rails
end
Suspect the gems have moved on but as usual the documentation doesn't tell you.
Ryan, you are a really mean guy, you know? I wanted to use the easter weekend to get forward with my app, but I guess, now I'm gonna play around with cukes all day long. ;)
missing in your code listing:
# config/routes.rb
map.resource :articles
ups... should be:
# config/routes.rb
map.resources :articles
OK, repeated you tutorial. Just started with Rails and wanted to check out a good TDD scheme for Ruby and found Cucumber & RSpec. The homepages are nice for experts, but not a single step-by-step guide for getting it to work for newbs. Especially the rake commands are given NOWHERE and as a newb the problem with tables reported by Cucumber (if you don't know you need to clone) and the official Cucumber Wiki example actually using a table in the feature got me going crazy... Your railscast on this should become part of the official documentation! Thanks loads, man!!!
Great screencast as always!!
I am new to BDD and am trying to figure out when it is that one would use rspec in this process? After the Cucumber features pass? Would rspec just get used for unit testing at that point?
Thanks again!
Eric
Hi,
for all windows (Netbeans) developers:
I've written a Module for Netbeans which allows "Syntax Highlighting" and more for .feature files.
So if you are interested in it, you can find it on the Netbeans homepage:
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=17939
or on my homepage:
http://members.chello.at/server/modules.html
Thanks once again for your railscasts, Ryan!
I'm now learning cucumber and found your explanations very concise and helpful. :)
Thanks for the great Railscasts...
I had trouble installing webrat on ubuntu until I installed the required packages described on this page http://wiki.rubyonrails.org/testing/webrat#installation
-- Jean-Marc
If you are new and following along at home with a newer version of Cucumber (I've got 0.3.5), the -n switch for the "cucumber features" command will generate an error. Apparently -n refers to a different option in later versions, and the current equivalent is "--no-source".
Love these testing screencasts, Ryan! They are the only comprehensive source I've seen that walks through using all of the tools together to write tests for and code for a vaguely realistic Rails app, without assuming I am already a testing wizard.
That 's so cool.
Hey Guys,
Don't panic if you are getting below error when you tried to run "cucumber features -n":
missing argument: -n (OptionParser::MissingArgument)
You are getting this error because cucumber version is now updated.
Try to run "cucumber features" and it will work fine!!!
Hi,
First of all thanks for making this tutorial, someone told me it was a good one to learn from.
Here's my current problem
~/www/blog$ cucumber features -n
bash: cucumber: command not found
Any idea what i can do ? i haven't been able to find a fix on Google ( perhaps i was searching improperly )
I have posted a version for people with Ubuntu 9.04 to give this a shot. I hope you guys dont mind. I did give credit at the top of the post.
http://aslambilal.blogspot.com/2009/06/beginning-with-cucumber-for-ubuntu-904.html
Great introduction to cucumber! I already knew the framework and noticed, that you're pointing out the power of it very clear. A great starting-point for your audience.
I'm unable to download the screencasts, too. Seems that the media server is down.
I've created a custom formatter that generates better HTML output for use with your cucumber projects and textmate
I've created a custom formatter that generates better HTML output for use with your cucumber projects and textmate
http://github.com/raldred/cucumber_textmate/tree/master
I just installed Cucumber and Ruby on Rails on a Fedora 12 virtual machine. I am having the following issue complaining about jopenssl. Any ideas what could be wrong? Thanks
[root@bldr-vcm25 blog]# rake gems:install RAILS_ENV=test --trace
(in /home/aavella/Documents/blog)
** Invoke gems:install (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
rake aborted!
no such file to load -- jopenssl
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:271:in `require_frameworks'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:134:in `process'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run'
/home/aavella/Documents/blog/config/environment.rb:9
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/tasks/misc.rake:4
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/tasks/gems.rake:17
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
[root@bldr-vcm25 blog]#
Thanks for the great screencast, Ryan.
Note:
From Cucumber 0.4.5 and onwards you will also need to install the 'cucumber-rails' gem, or else 'script/generate cucumber' will fail.
thanks for the tutorial. its great
FYI, as of cucumber-0.4.2 you'll need to use cucumber-rails otherwise the generators wont work.
sudo gem install cucumber-rails
config.gem "cucumber-rails"
Hi,nice article for beginners.I would like to know if cucumber works for AJAX based functions.If yes,how?If no,Why?how can it be achieved?
thanks JPB, script/generate cucumber didn't work for me, your comment just made the trick: you need cucumber-rails gem now
I used Term for a class name but it seems to be incompatible with Cucumber. Thanks for all the podcasts. http://stackoverflow.com/questions/1736747/how-to-resolve-rails-model-namespace-collision
I'm getting funky error output (not matching yours). cucumber seems to be suppressing the errors? See http://stackoverflow.com/questions/3232856/cucumber-errors-suppressed-not-displayed-fully for full details.
Any suggestions?
What is the "rail blog" command from the very first line of the code?
I am facing this when I am going to run : spec spec/models/article_spec.rb --format specdoc
`require': no such file to load -- /home/barek/projects/blog/spec/spec_helper (LoadError)
Please help me
can someone update the commands for Rails 3.1?
For Rails3.1 see http://ridingrails.net/rails-3-cucumber-started-outside-in-testing/
Important remark for everyone who's missing the webrat_steps.rb or the web_steps.rb -they've been removed to avoid that people continue building up (poor) tests based on these "training wheels" ... see http://aslakhellesoy.com/post/11055981222/the-training-wheels-came-off
An update to this railscast to help write better cucumber scripts would be a welcome step forward.
Totally agree. Especially since "The training wheels came off"
This is horrendous - by the time you had written all the regex's for every bit of your code you could have written tests by hand much quicker. It is like you are making up regex'sa to explain english statements instead of logically doing something - seems really convoluted to me.
Am I not getting something? I was checking all over to see if this was a practical joke or something.
+1 for an updated railscast on Cucumber.
There still seems to be a problem playing this video. It works if you manually skip to a few minutes in but the video freezes up after the intro graphic if you start from 0s. Strangely the audio is fine throughout.
+1 for an updated railscast
@Ryan: thanks for good screen cast. it was help full my self but some customization require for me like:
<%= form_for object %>
I follow "New Article" need to pass one more pending below.
When(/^I follow "(.*?)"$/) do |arg1|
click_link(arg1)
end
thanks.
Thanks Ryan and your team. This site is extremely help me to learn new things easy way in ROR. Recently I have started Testing using Cucumber and I tried to install it as you have described.
I am using Rails 3.2
ISSUE: when I try to run rake cucumber I am getting this error:-
"Rack::File headers parameter replaces cache_control after Rack 1.5.uninitialized constant SimpleForm (NameError)"
Can anyone please help me to resolve it? Thanks in advance... :)
It's solved by updating my Rails version 3.2.12 to 3.2.13