Skip to content

Commit 980fd25

Browse files
author
İsmail Akbudak
committed
Fix broken specs after changes
1 parent b5cde72 commit 980fd25

11 files changed

+18
-26
lines changed

lib/cybele/generators/app_generator.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ def initialize(*args)
8686
def customize_gemfile
8787
say 'Customize gem file', :green
8888
build :add_gems
89-
bundle_command 'update thor'
9089
build :add_simple_form_gem unless @options[:skip_simple_form]
9190
build :add_show_for_gem unless @options[:skip_show_for]
9291
build :add_haml_gems unless @options[:skip_haml]

spec/features/new_default_project_spec.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
expect(readme_file).to match(/^➜ ✗ redis-server/)
1919
end
2020

21-
it 'uses postgresql database template' do
22-
database_file = content('config/database.yml')
23-
expect(database_file).to match(/^connection: &connection/)
24-
expect(database_file).to match(/^ database: #{app_name}_staging/)
25-
end
21+
it_behaves_like 'uses postgresql database'
2622

2723
it_behaves_like 'uses sidekiq'
2824

spec/features/new_not_default_project_spec.rb

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,7 @@
99
setup_app_dependencies
1010
end
1111

12-
it 'uses sqlite3 instead of default pg in Gemfile' do
13-
gemfile_file = content('Gemfile')
14-
readme_file = content('README.md')
15-
expect(gemfile_file).not_to match(/^gem 'pg'/)
16-
expect(gemfile_file).to match(/^gem 'sqlite3'/)
17-
expect(readme_file).to match(/^# #{app_name.capitalize}/)
18-
expect(readme_file).not_to match(/^# Docker development/)
19-
expect(readme_file).not_to match(/^➜ ✗ redis-server/)
20-
end
21-
22-
it 'uses sqlite3 database template' do
23-
database_file = content('config/database.yml')
24-
expect(database_file).to match(/^default: &default/)
25-
expect(database_file).to match(/adapter: sqlite3/)
26-
end
12+
it_behaves_like 'uses postgresql database'
2713

2814
it 'do not use sidekiq' do
2915
gemfile_file = content('Gemfile')

spec/files/README_DEFAULT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Change email sender domain address and basic_auth info in `config/settings.yml`
55
- Change email sender domain address in `config/initializers/devise.rb`
66
- Create `.pronto.yml` file from `example.pronto.yml` file
7+
- Run command for create environments ➜ ✗ `rails g environment`
78

89
# Infos
910
- Edit secret keys

spec/files/README_ONLY_NO_SKIP_DOCKER.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Change email sender domain address and basic_auth info in `config/settings.yml`
55
- Change email sender domain address in `config/initializers/devise.rb`
66
- Create `.pronto.yml` file from `example.pronto.yml` file
7+
- Run command for create environments ➜ ✗ `rails g environment`
78

89
# Infos
910
- Edit secret keys

spec/files/README_ONLY_NO_SKIP_SIDEKIQ.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Change email sender domain address and basic_auth info in `config/settings.yml`
55
- Change email sender domain address in `config/initializers/devise.rb`
66
- Create `.pronto.yml` file from `example.pronto.yml` file
7+
- Run command for create environments ➜ ✗ `rails g environment`
78

89
# Infos
910
- Edit secret keys

spec/files/README_SKIP_ALL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Change email sender domain address and basic_auth info in `config/settings.yml`
55
- Change email sender domain address in `config/initializers/devise.rb`
66
- Create `.pronto.yml` file from `example.pronto.yml` file
7+
- Run command for create environments ➜ ✗ `rails g environment`
78

89
# Infos
910
- Edit secret keys

spec/support/cybele_test_helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def cybele_not_default_parameters(no_skips: [])
2828
skips = commands.map do |command|
2929
"--skip-#{command}"
3030
end
31-
'--database=sqlite3 ' + skips.join(' ')
31+
'--skip-create-database ' + skips.join(' ')
3232
end
3333

3434
def content(file_path)

spec/support/shared_examples/locale_language_test_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
def file_content_control_test
1414
locale_file = content('config/locales/tr.yml')
15-
expect(locale_file).to match('phone:')
1615
expect(locale_file).to match('date:')
1716
expect(locale_file).to match('time:')
1817
expect(locale_file).to match('number:')
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
shared_examples 'uses postgresql database' do
4+
context do
5+
it do
6+
database_file = content('config/database.yml')
7+
expect(database_file).to match(/^connection: &connection/)
8+
expect(database_file).to match(/^ database: #{app_name}_staging/)
9+
end
10+
end
11+
end

templates/Gemfile.erb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11

2-
# General requirement
3-
gem 'thor', '~> 0.19.4'
4-
52
# For never accidentally send emails to real people from staging environment.
63
gem 'recipient_interceptor', '~> 0.2.0'
74

0 commit comments

Comments
 (0)