Skip to content

Commit

Permalink
Merge branch 'main' into add-primer_view_components
Browse files Browse the repository at this point in the history
  • Loading branch information
YutaGoto committed Nov 16, 2023
2 parents 0f201ee + 4946742 commit 3f8be12
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 30 deletions.
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,9 @@ WORKDIR /app
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -

# Add packages
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
git \
nodejs \
vim

# Add Chrome
RUN curl -sO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& apt-get install -y ./google-chrome-stable_current_amd64.deb \
&& rm google-chrome-stable_current_amd64.deb

# Add chromedriver
RUN CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` \
&& curl -sO https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
&& unzip chromedriver_linux64.zip \
&& mv chromedriver /usr/bin/chromedriver
vim \
chromium \
chromium-driver
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara"
gem "selenium-webdriver"
gem "webdrivers"
gem "rspec-rails"
gem "factory_bot_rails"
end

gem "view_component", "~> 3.6"

gem "view_component", "~> 3.7"
gem "primer_view_components", "~> 0.11.0"
9 changes: 2 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ GEM
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
view_component (3.6.0)
view_component (3.7.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
Expand All @@ -301,10 +301,6 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.2.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webrick (1.8.1)
websocket (1.2.9)
websocket-driver (0.7.6)
Expand Down Expand Up @@ -339,9 +335,8 @@ DEPENDENCIES
stimulus-rails
turbo-rails
tzinfo-data
view_component (~> 3.6)
view_component (~> 3.7)
web-console
webdrivers

RUBY VERSION
ruby 3.2.2p53
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
module Beerkeeper
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
config.load_defaults 7.2
config.generators.test_framework = :rspec

# Configuration for the application, engines, and railties goes here.
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2022_05_12_122510) do
ActiveRecord::Schema[7.2].define(version: 2022_05_12_122510) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:

web: &web
build: .
image: app:1.0.0
image: app:1.1.0
stdin_open: true
tty: true
volumes:
Expand Down
19 changes: 19 additions & 0 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Capybara.register_driver :selenium_chrome_headless do |app|
options = ::Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-gpu')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--window-size=1400,1400')
driver = Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
end

RSpec.configure do |config|
config.before(:each, type: :system) do
driven_by :rack_test
end

config.before(:each, type: :system, js: true) do
driven_by(:selenium_chrome_headless)
end
end
2 changes: 1 addition & 1 deletion spec/system/events_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "rails_helper"

RSpec.describe "events", type: :system do
RSpec.describe "events", type: :system, js: true do
it "enables me to create widgets" do
visit "/events" # /booksへHTTPメソッドGETでアクセス
expect(page).to have_text("イベント一覧") # 表示されたページに Books という文字があることを確認
Expand Down
2 changes: 1 addition & 1 deletion spec/system/participations_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe 'Participations', type: :system do
RSpec.describe 'Participations', type: :system, js: true do
let(:user) { create(:user) }
let(:organizer) { create(:user) }
let(:event) { create(:event, organizer: organizer) }
Expand Down
2 changes: 1 addition & 1 deletion spec/system/registrations_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "rails_helper"

RSpec.describe "registrations", type: :system do
RSpec.describe "registrations", type: :system, js: true do
describe "Signup" do
before do
visit signup_path
Expand Down
2 changes: 1 addition & 1 deletion spec/system/sessions_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "rails_helper"

RSpec.describe "sessions", type: :system do
RSpec.describe "sessions", type: :system, js: true do
describe "Login" do
let(:user) { FactoryBot.create(:user) }

Expand Down

0 comments on commit 3f8be12

Please sign in to comment.