Skip to content

Commit d05938d

Browse files
committed
trying things
1 parent f3934af commit d05938d

File tree

7 files changed

+59
-11
lines changed

7 files changed

+59
-11
lines changed

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM 335883679137.dkr.ecr.us-west-2.amazonaws.com/wearefine/base_ruby:2.3.1
2+
3+
ENV app /app
4+
ENV BUNDLE_PATH /gems
5+
ENV GEM_HOME /gems
6+
7+
COPY Gemfile* $app/
8+
9+
ENV PATH="$PATH:$BUNDLE_PATH/bin"
10+
11+
COPY . $app/
12+
13+
14+

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ group :test, :development do
2727
end
2828

2929
group :test do
30-
gem 'factory_girl_rails', '~> 4.4.1'
30+
gem 'factory_girl_rails', '~> 4.4.1', :require => false
3131
gem 'capybara-webkit', '~> 1.11.1'
3232
gem 'capybara-screenshot'
3333
gem 'guard-rspec', '~> 4.7.3'

Gemfile.lock

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ GEM
205205
mime-types (3.1)
206206
mime-types-data (~> 3.2015)
207207
mime-types-data (3.2016.0521)
208-
mimemagic (0.3.2)
208+
mimemagic (0.3.10)
209+
nokogiri (~> 1)
210+
rake
209211
mini_magick (4.9.3)
210212
mini_mime (1.0.0)
211213
mini_portile2 (2.3.0)
@@ -381,4 +383,4 @@ DEPENDENCIES
381383
yarjuf
382384

383385
BUNDLED WITH
384-
1.17.0
386+
1.17.3

docker-compose.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: '3.3'
2+
volumes:
3+
gems:
4+
services:
5+
app:
6+
build: .
7+
working_dir: /app/spec/dummy
8+
# command: /bin/bash -c "RAILS_ENV=test && bundle exec rake db:create db:migrate && rspec"
9+
command: /bin/bash -c "bundle check || bundle install && bundle exec rails s -p 3000 -P /tmp/puma.pid -b 0.0.0.0"
10+
volumes:
11+
- gems:/gems
12+
- .:/app
13+
ports:
14+
- '3000:3000'
15+
depends_on:
16+
- db
17+
environment:
18+
- RAILS_ENV=development
19+
- DEV_MYSQL_HOST=db
20+
db:
21+
image: mariadb:10.2
22+
environment:
23+
- MYSQL_ROOT_PASSWORD=
24+
- MYSQL_ALLOW_EMPTY_PASSWORD='yes'
25+
ports:
26+
- '3307:3306'
27+
volumes:
28+
- /private/app/dbs

spec/dummy/config/database.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ base: &base
99

1010
development:
1111
<<: *base
12+
host: <%= ENV['DEV_MYSQL_HOST'] || 'localhost' %>
1213

1314
test:
1415
<<: *base
1516
database: <%= ENV['MYSQL_DATABASE'] || 'fae_dummy_test' %>
1617
username: <%= ENV['MYSQL_USER'] || 'root' %>
1718
password: <%= ENV['MYSQL_PASSWORD'] %>
19+
host: <%= ENV['DEV_MYSQL_HOST'] || 'localhost' %>
1820

1921

2022
remote_development:

spec/dummy/db/schema.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
create_table "fae_files", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
122122
t.string "name"
123123
t.string "asset"
124-
t.integer "fileable_id"
125124
t.string "fileable_type"
125+
t.integer "fileable_id"
126126
t.integer "file_size"
127127
t.integer "position", default: 0
128128
t.string "attached_as"
@@ -131,7 +131,8 @@
131131
t.datetime "created_at"
132132
t.datetime "updated_at"
133133
t.boolean "required", default: false
134-
t.index ["fileable_id", "fileable_type"], name: "index_fae_files_on_fileable_id_and_fileable_type"
134+
t.index ["attached_as"], name: "index_fae_files_on_attached_as"
135+
t.index ["fileable_type", "fileable_id"], name: "index_fae_files_on_fileable_type_and_fileable_id"
135136
end
136137

137138
create_table "fae_form_managers", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
@@ -147,8 +148,8 @@
147148
create_table "fae_images", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
148149
t.string "name"
149150
t.string "asset"
150-
t.integer "imageable_id"
151151
t.string "imageable_type"
152+
t.integer "imageable_id"
152153
t.string "alt"
153154
t.string "caption"
154155
t.integer "position", default: 0
@@ -159,7 +160,8 @@
159160
t.datetime "updated_at"
160161
t.integer "file_size"
161162
t.boolean "required", default: false
162-
t.index ["imageable_id", "imageable_type"], name: "index_fae_images_on_imageable_id_and_imageable_type"
163+
t.index ["attached_as"], name: "index_fae_images_on_attached_as"
164+
t.index ["imageable_type", "imageable_id"], name: "index_fae_images_on_imageable_type_and_imageable_id"
163165
end
164166

165167
create_table "fae_options", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
@@ -212,8 +214,8 @@
212214
end
213215

214216
create_table "fae_text_fields", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
215-
t.integer "contentable_id"
216217
t.string "contentable_type"
218+
t.integer "contentable_id"
217219
t.string "attached_as"
218220
t.string "label"
219221
t.string "content"
@@ -223,7 +225,7 @@
223225
t.datetime "created_at"
224226
t.datetime "updated_at"
225227
t.index ["attached_as"], name: "index_fae_text_fields_on_attached_as"
226-
t.index ["contentable_id", "contentable_type"], name: "index_fae_text_fields_on_contentable_id_and_contentable_type"
228+
t.index ["contentable_type", "contentable_id"], name: "index_fae_text_fields_on_contentable_type_and_contentable_id"
227229
t.index ["on_prod"], name: "index_fae_text_fields_on_on_prod"
228230
t.index ["on_stage"], name: "index_fae_text_fields_on_on_stage"
229231
t.index ["position"], name: "index_fae_text_fields_on_position"

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
require 'yarjuf'
88
require 'factory_girl_rails'
99
require 'database_cleaner'
10-
require 'rspec/rails'
1110
require 'shoulda/matchers'
11+
require 'rspec/rails'
1212
require 'pry'
1313

1414
# File.dirname(__FILE__) used because Rails.root is the dummy app
@@ -41,7 +41,7 @@
4141
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
4242
config.include FactoryGirl::Syntax::Methods
4343
FactoryGirl.definition_file_paths = [File.expand_path('../factories', __FILE__)]
44-
FactoryGirl.find_definitions
44+
4545

4646
# If you're not using ActiveRecord, or you'd prefer not to run each of your
4747
# examples within a transaction, remove the following line or assign false

0 commit comments

Comments
 (0)