/
add_migrations_to_project.feature
36 lines (32 loc) · 1.2 KB
/
add_migrations_to_project.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Feature: add migrations to the project
Background:
Given I have a project with clearance
Scenario: Users table does not exist
When I install dependencies
And I successfully run `bundle exec rails generate clearance:install`
And I successfully run `ls db/migrate`
Then the output should contain:
"""
create_users.rb
"""
Scenario: Users table without clearance fields exists in the database
When I install dependencies
And I create a simple user model
And I add an existing user
And I successfully run `bundle exec rails generate clearance:install`
And I successfully run `bundle exec rake db:migrate`
Then the output should contain:
"""
add_clearance_to_users.rb
"""
And the existing user should have a remember token
Scenario: Users table with clearance fields exists in the database
When I install dependencies
And I create a migration with clearance fields
And I successfully run `bundle exec rake db:migrate`
And I successfully run `bundle exec rails generate clearance:install`
And I successfully run `ls db/migrate`
Then the output should not contain:
"""
add_clearance_to_users.rb
"""