-
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.
Merge pull request #3 from AntonioHincapie/test
Test
- Loading branch information
Showing
13 changed files
with
117 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Categories', type: :system do | ||
describe 'category#index page:' do | ||
it 'Should render home page' do | ||
visit('http://localhost:3000/categories') | ||
expect(page).to have_content('Money Tracker') | ||
end | ||
|
||
it 'Should render list of movements' do | ||
visit('http://localhost:3000/categories/1') | ||
expect(page).to have_content('Log') | ||
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'Splash', type: :feature do | ||
describe 'Splash#index page:' do | ||
before(:each) do | ||
visit root_path | ||
end | ||
|
||
it 'Should show the page header' do | ||
expect(page).to have_current_path root_path | ||
end | ||
|
||
context 'When click on Log in button' do | ||
it 'Should show the page header' do | ||
first(:link_or_button, 'Log In').click | ||
|
||
expect(page).to have_current_path new_user_session_path | ||
end | ||
end | ||
|
||
context 'When click on Sign up button' do | ||
it 'Should show the page header' do | ||
first(:link_or_button, 'Sign Up').click | ||
|
||
expect(page).to have_current_path new_user_registration_path | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,5 +1,24 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Category, type: :model do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
before do | ||
@user = User.create(name: 'Antonio', email: 'antonio@mail.com') | ||
@user.password = 'pass1234' | ||
@user.password_confirmation = 'pass1234' | ||
@category = Category.create(name: 'Cash', icon: 'icon', user_id: @user.id) | ||
end | ||
|
||
context 'When testing Category class' do | ||
it 'Should have a name' do | ||
expect(@category.name).to eq('Cash') | ||
end | ||
|
||
it 'Should have a icon' do | ||
expect(@category.icon).to eq('icon') | ||
end | ||
|
||
it 'Should have an author' do | ||
expect(@category.user_id).to eq(@user.id) | ||
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,5 +1,22 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Clasification, type: :model do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
before do | ||
@user = User.create(name: 'Antonio', email: 'antonio@mail.com') | ||
@user.password = 'pass1234' | ||
@user.password_confirmation = 'pass1234' | ||
@category = Category.create(name: 'Cash', icon: 'icon', user_id: @user.id) | ||
@movement = Movement.create(name: 'Uber', amount: 15.67, user_id: @user.id) | ||
@clasification = Clasification.create(movement_id: @movement.id, category_id: @category.id) | ||
end | ||
|
||
context 'When testing Movement class' do | ||
it 'Should have a movement related' do | ||
expect(@clasification.movement_id).to eq(@movement.id) | ||
end | ||
|
||
it 'Should have a category related' do | ||
expect(@clasification.category_id).to eq(@category.id) | ||
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,5 +1,24 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Movement, type: :model do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
before do | ||
@user = User.create(name: 'Antonio', email: 'antonio@mail.com') | ||
@user.password = 'pass1234' | ||
@user.password_confirmation = 'pass1234' | ||
@movement = Movement.create(name: 'Uber', amount: 15.67, user_id: @user.id) | ||
end | ||
|
||
context 'When testing Movement class' do | ||
it 'Should have a name' do | ||
expect(@movement.name).to eq('Uber') | ||
end | ||
|
||
it 'Should have a amount' do | ||
expect(@movement.amount).to eq(15.67) | ||
end | ||
|
||
it 'Should have an author' do | ||
expect(@movement.user_id).to eq(@user.id) | ||
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,5 +1,19 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe User, type: :model do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
before do | ||
@user = User.create(name: 'Antonio', email: 'antonio@mail.com') | ||
@user.password = 'pass1234' | ||
@user.password_confirmation = 'pass1234' | ||
end | ||
|
||
context 'When testing User class' do | ||
it 'Should have a name' do | ||
expect(@user.name).to eq('Antonio') | ||
end | ||
|
||
it 'Should have a email' do | ||
expect(@user.email).to eq('antonio@mail.com') | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.