-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
33 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
password_confirmation { 'password' } | ||
name { Faker::Name.name } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
it 'has password' do | ||
expect(user.password).to be_present | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,35 +72,32 @@ | |
end | ||
end | ||
class TestConfiguration | ||
@@example_user = nil | ||
@example_user = nil | ||
|
||
def self.example_user | ||
@@example_user ||= create_example_user | ||
@example_user ||= create_example_user | ||
end | ||
|
||
def self.create_example_user | ||
# Crea el usuario de ejemplo y devuélvelo | ||
user = User.create!( | ||
name: "Ejemplo Usuario", | ||
email: "[email protected]", | ||
password: "password123", | ||
name: 'Ejemplo Usuario', | ||
email: '[email protected]', | ||
password: 'password123', | ||
confirmed_at: Time.now | ||
) | ||
# Crea las comidas "Banana" y "Apple" asociadas al usuario | ||
|
||
create_food(user, 'Banana') | ||
create_food(user, 'Apple') | ||
user | ||
end | ||
|
||
private | ||
|
||
def self.create_food(user, name) | ||
Food.create!( | ||
name: name, | ||
measurement_unit: "unit", | ||
name:, | ||
measurement_unit: 'unit', | ||
price: 1, | ||
quantity: 1, | ||
user: user | ||
user: | ||
) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ def login_user | |
sign_in user | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
require_relative './controller_auth' | ||
require_relative 'controller_auth' | ||
|
||
RSpec.configure do |config| | ||
config.include Devise::Test::ControllerHelpers, type: :controller | ||
# config.extend ControllerAuth, type: :controller | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
RSpec.configure do |config| | ||
config.include FactoryBot::Syntax::Methods | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters