Skip to content

Commit

Permalink
modernize gems and dependencies.
Browse files Browse the repository at this point in the history
Closes #50

This patch replaces the deprecated `sass-rails` gem with
`sassc-rails`. It  also modernizes the testing dependencies and now
uses a headless chrome driver (`apparition`) instead of `poltergeist`.
  • Loading branch information
senny committed Sep 25, 2020
1 parent e29b6e3 commit c7964f9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ gemspec

group :test do
gem 'capybara', '>= 2.1'
gem 'poltergeist', '~> 1.5'
gem 'apparition'
gem 'puma'
end
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ tested on S3:
Tests can be executed with:

```
$ bundle exec rake
$ bin/rake
```

This will render the sample.pdf using phantomjs and save screenshots into `test/sandbox`.
This will render the sample.pdf using headless chrome and save screenshots into `test/sandbox`.

## License

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.rails-5-2-stable
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ gem "rails", git: "https://github.com/rails/rails.git", branch: "5-2-stable"

group :test do
gem 'capybara', '>= 2.1'
gem 'poltergeist', '~> 1.5'
gem 'apparition'
gem 'puma'
end
2 changes: 1 addition & 1 deletion gemfiles/Gemfile.rails-6-0-stable
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ gem "rails", git: "https://github.com/rails/rails.git", branch: "6-0-stable"

group :test do
gem 'capybara', '>= 2.1'
gem 'poltergeist', '~> 1.5'
gem 'apparition'
gem 'puma'
end
2 changes: 1 addition & 1 deletion pdfjs_viewer-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.test_files = Dir["test/**/*"]

s.add_dependency "rails", "> 4.2.0"
s.add_dependency "sass-rails", "> 5.0"
s.add_dependency "sassc-rails", ">= 2.1"
s.add_dependency "json", "> 1.8.4"

s.add_development_dependency "sqlite3"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/viewer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class ViewerTest < ActionDispatch::IntegrationTest

private
def assert_rendered_pdf(output, screenshot:)
assert_match(/PDF a0f29a2f4968123b2e931593605583c8/, output)
page.save_screenshot screenshot, full: true
assert_match(/PDF a0f29a2f4968123b2e931593605583c8/, output)
end

def capture(stream)
Expand Down
4 changes: 2 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
end

require 'capybara/apparition'
require 'capybara/rails'
require 'capybara/poltergeist'
require "timeout"

SANDBOX_PATH = Pathname.new(File.expand_path("sandbox", __dir__))
Expand All @@ -27,7 +27,7 @@

class ActionDispatch::IntegrationTest
include Capybara::DSL
Capybara.default_driver = :poltergeist
Capybara.default_driver = :apparition

def teardown
super
Expand Down

0 comments on commit c7964f9

Please sign in to comment.