diff --git a/.env.test b/.env.test index 97c3739..889ca78 100644 --- a/.env.test +++ b/.env.test @@ -11,7 +11,7 @@ PUMA_PORT=4000 PUMA_TIMEOUT=30 MYSQL_HOST=db -MYSQL_DATABASE=ensl +MYSQL_DATABASE=ensl_test MYSQL_USERNAME=ensl MYSQL_PASSWORD=ensl MYSQL_ROOT_PASSWORD=ensl diff --git a/.gitignore b/.gitignore index 6bf07a0..66dbfed 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ db_data* db_data/* !db_data/.placeholder +*.sql # OS X .DS_Store diff --git a/Gemfile b/Gemfile index 5217e71..a089a50 100644 --- a/Gemfile +++ b/Gemfile @@ -67,6 +67,7 @@ group :test do gem 'selenium-webdriver', '~> 2.47.1' gem 'factory_girl_rails', '~> 4.4.1' gem 'timecop', '~> 0.7.1' + gem 'rspec' end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index a031e86..afb09bb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -214,6 +214,10 @@ GEM ffi (~> 1.0) ref (2.0.0) rmagick (2.13.4) + rspec (3.3.0) + rspec-core (~> 3.3.0) + rspec-expectations (~> 3.3.0) + rspec-mocks (~> 3.3.0) rspec-core (3.3.2) rspec-support (~> 3.3.0) rspec-expectations (3.3.1) @@ -338,6 +342,7 @@ DEPENDENCIES rails (~> 4.1.16) rails_autolink (~> 1.1.5) rmagick (~> 2.13.4) + rspec rspec-rails (~> 3.3.3) sanitize (~> 2.1.0) sass-rails (~> 5.0.3) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 3f0aaed..eb3886c 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -25,12 +25,12 @@ services: - "./db_data:/var/lib/mysql" - "./ext/mysql.conf.d:/etc/mysql/conf.d" environment: - - MYSQL_DATABASE - - MYSQL_USER - - MYSQL_USERNAME - - MYSQL_PASSWORD - - MYSQL_ROOT_PASSWORD - - MYSQL_ROOT_HOST + - MYSQL_DATABASE=ensl + - MYSQL_USER=ensl + - MYSQL_USERNAME=ensl + - MYSQL_PASSWORD=ensl + - MYSQL_ROOT_PASSWORD=ensl + - MYSQL_ROOT_HOST=% memcached: image: memcached:latest #redis: diff --git a/spec/controllers/articles_controller_spec.rb b/spec/controllers/articles_controller_spec.rb new file mode 100644 index 0000000..41623e3 --- /dev/null +++ b/spec/controllers/articles_controller_spec.rb @@ -0,0 +1,8 @@ +require 'rails_helper' + +RSpec.describe ArticlesController, type: :controller do + it "renders the index template" do + get :index + expect(response).to render_template("index") + end +end diff --git a/spec/controllers/shoutmsgs_controller_spec.rb b/spec/controllers/shoutmsgs_controller_spec.rb new file mode 100644 index 0000000..f6aff94 --- /dev/null +++ b/spec/controllers/shoutmsgs_controller_spec.rb @@ -0,0 +1,8 @@ +require 'rails_helper' + +RSpec.describe ShoutmsgsController, type: :controller do + it "renders the index template" do + get :index + expect(response).to render_template("index") + end +end