Hey all,
I''m trying to get some Javascript test coverage in my app, so I
decided to implement Rspec and Capybara with Selenium. I follow Ryan
Bate''s Railscast episode 257 to a tee, but I still can''t get
it to work.
Problems arise when I add :js => true. Without it, the following DOES
work. Here''s the spec:
describe "Info Page" do
describe "GET /premium" do
it "shows the info page", :js => true do
visit ''/premium''
end
end
end
Which, when executed, outputs the following (with --trace):
Failures:
1) Info Page GET /premium shows the info page
Failure/Error: visit ''/premium''
TypeError:
Zip is not a module
# ./spec/requests/info_spec.rb:6:in `block (3 levels) in <top
(required)>''
Finished in 13.15 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/requests/info_spec.rb:5 # Info Page GET /premium shows the
info page
rake aborted!
ruby /Users/loadeddesigns/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -S rspec
./spec/requests/info_spec.rb failed
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rspec-core-2.7.1/lib/rspec/core/rake_task.rb:149:in
`block (2 levels) in initialize''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:60:in
`verbose''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rspec-core-2.7.1/lib/rspec/core/rake_task.rb:139:in
`block in initialize''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
`call''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
`block in execute''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
`each''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
`execute''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
`block in invoke_with_call_chain''
/Users/loadeddesigns/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in
`mon_synchronize''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
`invoke_with_call_chain''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/task.rb:144:in
`invoke''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
`invoke_task''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
`block (2 levels) in top_level''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
`each''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
`block in top_level''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
`standard_exception_handling''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:88:in
`top_level''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
`block in run''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
`standard_exception_handling''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
`run''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/gems/rake-0.9.2.2/bin/rake:33:in
`<top (required)>''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/bin/rake:19:in
`load''
/Users/loadeddesigns/.rvm/gems/ruby-1.9.2-p290@coverhound/bin/rake:19:in
`<main>''
I am having a really hard time trying to track down the cause of this...
Heck, the only reason why I am using RSpec and Capybara is for
Javascript support (other tests in the app use test unit).
Any and all help is appreciated!
Thanks,
- Jeff
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.