Skip to content

Commit

Permalink
Add .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Apr 29, 2018
1 parent c99f9bb commit e08ea9a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 11 deletions.
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
language: ruby

before_install: gem install bundler

bundler_args: --without development --jobs=3 --retry=3 --path=../vendor/bundle

cache: bundler

env:
matrix:
- JQUERY_VERSION=

rvm:
- 2.3.6

gemfile:
- gemfiles/rails_3.2.gemfile
- gemfiles/rails_4.2.gemfile
- gemfiles/rails_5.2.gemfile

dist: trusty

sudo: false

matrix:
include:
- env: JQUERY_VERSION=2
gemfile: gemfiles/rails_5.2.gemfile
- env: JQUERY_VERSION=3
gemfile: gemfiles/rails_5.2.gemfile
fast_finish: true
12 changes: 5 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end

begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
Expand All @@ -51,3 +44,8 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

task default: :spec
8 changes: 4 additions & 4 deletions spec/features/comments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,20 @@
click_button 'Create Comment'

expect(page).to have_css("div.remotipart", :count => 1)
# Needed to force page capybara to wiat for the above requests to finish
# Needed to force page capybara to wait for the above requests to finish
form = find('form')

# replace form html, in order clear out the file field (couldn't think of a better way)
page.execute_script("inputs = $('form').find(':file'); inputs.remove();")
page.evaluate_script("inputs = $('form').find(':file'); inputs.remove();")
fill_in 'comment_subject', with: 'Hi'
fill_in 'comment_body', with: 'there'
click_button 'Create Comment'

expect(page).to have_css("div.remotipart", :count => 1)
# Needed to force page capybara to wiat for the above requests to finish
# Needed to force page capybara to wait for the above requests to finish
form = find('form')

page.execute_script("$('form').append(inputs);")
page.evaluate_script("$('form').append(inputs);")
fill_in 'comment_subject', with: 'Hi'
fill_in 'comment_body', with: 'there'
attach_file 'comment_attachment', file_path
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require 'database_cleaner'

Capybara.javascript_driver = :poltergeist
Capybara.default_max_wait_time = 5

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Expand Down

0 comments on commit e08ea9a

Please sign in to comment.