Last active
January 17, 2018 13:15
-
-
Save rodolfopeixoto/e7caafc83ff2d391332a0c8dc504e3ee to your computer and use it in GitHub Desktop.
Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.1' | |
services: | |
db: | |
image: postgres | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD= | |
ports: | |
- '5432' | |
web: | |
build: . | |
command: bundle exec rails s -p 3000 -b '0.0.0.0' | |
volumes: | |
- .:/ticketee | |
ports: | |
- "3000:3000" | |
depends_on: | |
- db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.3.1 | |
RUN apt-get update -yqq \ | |
&& apt-get install -yqq --no-install-recommends \ | |
postgresql-client \ | |
nodejs \ | |
qt5-default \ | |
libqt5webkit5-dev \ | |
&& apt-get -q clean \ | |
&& rm -rf /var/lib/apt/lists | |
# for nokogiri | |
RUN apt-get -qq update && apt-get install -yqq libxml2-dev libxslt1-dev | |
# for capybara-webkit | |
RUN apt-get -qq update && apt-get install -yqq libqt4-webkit libqt4-dev xvfb | |
RUN apt-get install -yqq qt5-default qttools5-dev-tools | |
WORKDIR /ticketee | |
COPY Gemfile* ./ | |
RUN bundle install | |
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
ENV['RAILS_ENV'] ||= 'test' | |
require File.expand_path('../../config/environment', __FILE__) | |
abort("The Rails environment is running in production mode!") if Rails.env.production? | |
require 'rspec/rails' | |
require 'faker' | |
require 'pry' | |
require 'pundit/rspec' | |
# require 'selenium-webdriver' | |
Dir[Rails.root.join('spec/support/**/*.rb')].each { |file| require file } | |
ActiveRecord::Migration.maintain_test_schema! | |
# if ENV['SELENIUM_REMOTE_HOST'] | |
# Capybara.javascript_driver = :selenium_remote_firefox | |
# Capybara.register_driver "selenium_remote_firefox".to_sym do |app| | |
# Capybara::Selenium::Driver.new( | |
# app, | |
# browser: :remote, | |
# url: "http://#{ENV['SELENIUM_REMOTE_HOST']}:#{ENV['SELENIUM_REMOTE_PORT']}/wd/hub", | |
# desired_capabilities: :firefox) | |
# end | |
# end | |
Capybara.javascript_driver = :webkit | |
RSpec.configure do |config| | |
config.fixture_path = "#{::Rails.root}/spec/fixtures" | |
config.use_transactional_fixtures = false | |
config.infer_spec_type_from_file_location! | |
config.filter_rails_from_backtrace! | |
config.include FactoryBot::Syntax::Methods | |
config.include Warden::Test::Helpers, type: :feature | |
config.include Devise::Test::ControllerHelpers, type: :controller | |
config.after(type: :feature) { Warden.test_reset! } | |
# SELENIUM DOCKER | |
# config.before(:each) do | |
# if /selenium_remote/.match Capybara.current_driver.to_s | |
# ip = `/sbin/ip route|awk '/scope/ { print $9 }'` | |
# ip = ip.gsub "\n", "" | |
# Capybara.server_port = "3000" | |
# Capybara.server_host = ip | |
# Capybara.app_host = "http://#{Capybara.current_session.server.host}:#{Capybara.current_session.server.port}" | |
# end | |
# end | |
# config.after(:each) do | |
# Capybara.reset_sessions! | |
# Capybara.use_default_driver | |
# Capybara.app_host = nil | |
# end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment