Permalink
Browse files

Clean up specs a bit

* Use expect syntax
* Use `have_css` instead of assuming `find` will not raise an exception
  • Loading branch information...
1 parent 73e3a65 commit b76a14fe50a32f3ccd7eac5c9c109b4cb42f7885 @gabebw gabebw committed Nov 18, 2013
Showing with 4 additions and 3 deletions.
  1. +2 −0 spec/dummy/config/boot.rb
  2. +2 −2 spec/features/upload_spec.rb
  3. +0 −1 spec/spec_helper.rb
@@ -3,6 +3,8 @@
if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler/setup'
+else
+ raise 'dummy app could not find Gemfile'
end
$:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -5,7 +5,7 @@
visit root_path
attach_file 'upload', Rails.root.join(*%w(public ralph.png)).to_s
- find('.attachments img').should be_present
- Asset.last.file_file_name.should eq 'ralph.png'
+ expect(page).to have_css('.attachments img')
+ expect(Asset.last.file_file_name).to eq 'ralph.png'
end
end
View
@@ -1,7 +1,6 @@
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../spec/dummy/config/environment', __FILE__)
require 'rspec/rails'
-require 'rspec/autorun'
require 'database_cleaner'
Dir[Rails.root.join('spec/support/**/*.rb')].each {|f| require f}

0 comments on commit b76a14f

Please sign in to comment.