Skip to content

Commit

Permalink
Fix broken specs after changes
Browse files Browse the repository at this point in the history
  • Loading branch information
İsmail Akbudak committed Mar 8, 2019
1 parent b5cde72 commit 980fd25
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 26 deletions.
1 change: 0 additions & 1 deletion lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def initialize(*args)
def customize_gemfile
say 'Customize gem file', :green
build :add_gems
bundle_command 'update thor'
build :add_simple_form_gem unless @options[:skip_simple_form]
build :add_show_for_gem unless @options[:skip_show_for]
build :add_haml_gems unless @options[:skip_haml]
Expand Down
6 changes: 1 addition & 5 deletions spec/features/new_default_project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
expect(readme_file).to match(/^➜ ✗ redis-server/)
end

it 'uses postgresql database template' do
database_file = content('config/database.yml')
expect(database_file).to match(/^connection: &connection/)
expect(database_file).to match(/^ database: #{app_name}_staging/)
end
it_behaves_like 'uses postgresql database'

it_behaves_like 'uses sidekiq'

Expand Down
16 changes: 1 addition & 15 deletions spec/features/new_not_default_project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,7 @@
setup_app_dependencies
end

it 'uses sqlite3 instead of default pg in Gemfile' do
gemfile_file = content('Gemfile')
readme_file = content('README.md')
expect(gemfile_file).not_to match(/^gem 'pg'/)
expect(gemfile_file).to match(/^gem 'sqlite3'/)
expect(readme_file).to match(/^# #{app_name.capitalize}/)
expect(readme_file).not_to match(/^# Docker development/)
expect(readme_file).not_to match(/^➜ ✗ redis-server/)
end

it 'uses sqlite3 database template' do
database_file = content('config/database.yml')
expect(database_file).to match(/^default: &default/)
expect(database_file).to match(/adapter: sqlite3/)
end
it_behaves_like 'uses postgresql database'

it 'do not use sidekiq' do
gemfile_file = content('Gemfile')
Expand Down
1 change: 1 addition & 0 deletions spec/files/README_DEFAULT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Change email sender domain address and basic_auth info in `config/settings.yml`
- Change email sender domain address in `config/initializers/devise.rb`
- Create `.pronto.yml` file from `example.pronto.yml` file
- Run command for create environments ➜ ✗ `rails g environment`

# Infos
- Edit secret keys
Expand Down
1 change: 1 addition & 0 deletions spec/files/README_ONLY_NO_SKIP_DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Change email sender domain address and basic_auth info in `config/settings.yml`
- Change email sender domain address in `config/initializers/devise.rb`
- Create `.pronto.yml` file from `example.pronto.yml` file
- Run command for create environments ➜ ✗ `rails g environment`

# Infos
- Edit secret keys
Expand Down
1 change: 1 addition & 0 deletions spec/files/README_ONLY_NO_SKIP_SIDEKIQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Change email sender domain address and basic_auth info in `config/settings.yml`
- Change email sender domain address in `config/initializers/devise.rb`
- Create `.pronto.yml` file from `example.pronto.yml` file
- Run command for create environments ➜ ✗ `rails g environment`

# Infos
- Edit secret keys
Expand Down
1 change: 1 addition & 0 deletions spec/files/README_SKIP_ALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Change email sender domain address and basic_auth info in `config/settings.yml`
- Change email sender domain address in `config/initializers/devise.rb`
- Create `.pronto.yml` file from `example.pronto.yml` file
- Run command for create environments ➜ ✗ `rails g environment`

# Infos
- Edit secret keys
Expand Down
2 changes: 1 addition & 1 deletion spec/support/cybele_test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def cybele_not_default_parameters(no_skips: [])
skips = commands.map do |command|
"--skip-#{command}"
end
'--database=sqlite3 ' + skips.join(' ')
'--skip-create-database ' + skips.join(' ')
end

def content(file_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

def file_content_control_test
locale_file = content('config/locales/tr.yml')
expect(locale_file).to match('phone:')
expect(locale_file).to match('date:')
expect(locale_file).to match('time:')
expect(locale_file).to match('number:')
Expand Down
11 changes: 11 additions & 0 deletions spec/support/shared_examples/postgresql_test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

shared_examples 'uses postgresql database' do
context do
it do
database_file = content('config/database.yml')
expect(database_file).to match(/^connection: &connection/)
expect(database_file).to match(/^ database: #{app_name}_staging/)
end
end
end
3 changes: 0 additions & 3 deletions templates/Gemfile.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

# General requirement
gem 'thor', '~> 0.19.4'

# For never accidentally send emails to real people from staging environment.
gem 'recipient_interceptor', '~> 0.2.0'

Expand Down

0 comments on commit 980fd25

Please sign in to comment.