我正在尝试使用 launchy 来说明为什么我的规格不起作用但save_and_open_page
无法打开浏览器,并且在我运行我的规格时只会导致以下错误消息:
抱歉,您需要安装 launchy (
gem install launchy
) 并确保它可以打开带有save_and_open_page
.
我已经运行bundle install
并bundle show launchy
产生了:
/Users/benjaminunger/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/launchy-2.2.0
我的宝石文件:
group :development, :test do
gem "rspec-rails", "~> 2.13.0"
gem 'guard-rspec', '0.5.5'
gem 'growl', '1.0.3'
gem 'ruby_gntp', "0.3.4"
gem 'faker', '1.0.1'
end
group :development do
gem 'annotate', '~> 2.4.1.beta'
end
group :test do
gem 'capybara', '1.1.2'
gem 'rb-fsevent', '0.4.3.1', :require => false
gem 'guard-spork', '0.3.2'
gem 'spork', '0.9.2'
gem 'factory_girl_rails', '1.4.0'
gem "database_cleaner", "~> 0.9.1"
gem "launchy", "~> 2.2.0"
end
部分规格文件:
describe "clicking on 'Unapproved Users' link" do
before(:all) { User.delete_all }
before(:all) { 8.times { FactoryGirl.create(:not_approved) } }
let(:unapproved) { FactoryGirl.create(:not_approved) }
let(:admin) { FactoryGirl.create(:admin) }
after(:all) { User.delete_all }
before do
valid_signin(admin)
visit root_path
click_link "Unapproved Users"
save_and_open_page
end
it { should have_selector('h1', text: 'Unapproved Users') }
it { should have_selector('title', text: 'Unapproved Users') }
it { should have_link('approve', href: approve_user_path(User.first.id)) }
.
.
.
有人有想法么?非常感谢提前。