-
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 #14 from ITurres/feature/transaction-form-page
Issue #8 🎫: transaction form page
- Loading branch information
Showing
13 changed files
with
192 additions
and
147 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 |
---|---|---|
|
@@ -44,3 +44,8 @@ form { | |
margin-left: 25%; | ||
} | ||
} | ||
|
||
select { | ||
font-size: 1.2rem; | ||
padding: 0.3rem 0.1rem 0.3rem 0.2rem; | ||
} |
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
17 changes: 0 additions & 17 deletions
17
app/views/transaction_details/_transaction_detail.html.erb
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,9 +1,3 @@ | ||
<h1>New transaction detail</h1> | ||
<%= render "layouts/navbar", path: categories_path, title: "New transaction" %> | ||
|
||
<%= render "form", transaction_detail: @transaction_detail %> | ||
|
||
<br> | ||
|
||
<div> | ||
<%= link_to "Back to transaction details", transaction_details_path %> | ||
</div> | ||
<%= render "form", transaction_detail: @transaction_detail, categories: @categories %> |
4 changes: 2 additions & 2 deletions
4
db/migrate/20240108164210_create_category_transaction_details.rb
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
5 changes: 5 additions & 0 deletions
5
db/migrate/20240111003500_add_category_id_to_transaction_details.rb
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,5 @@ | ||
class AddCategoryIdToTransactionDetails < ActiveRecord::Migration[7.1] | ||
def change | ||
add_reference :transaction_details, :category, foreign_key: true | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe TransactionDetailsController, type: :controller do | ||
include Devise::Test::ControllerHelpers | ||
|
||
let(:user) { create(:user) } | ||
let(:category) { create(:category, user:) } | ||
let(:transaction_detail) { create(:transaction_detail, user:) } | ||
|
||
before do | ||
sign_in user | ||
end | ||
|
||
describe 'GET #new' do | ||
it 'returns a success response' do | ||
get :new | ||
expect(response).to be_successful | ||
end | ||
end | ||
|
||
describe 'POST #create' do | ||
context 'with valid params' do | ||
it 'creates a new TransactionDetail' do | ||
expect do | ||
post :create, params: { transaction_detail: attributes_for(:transaction_detail) } | ||
end.to change(TransactionDetail, :count).by(1) | ||
end | ||
end | ||
end | ||
|
||
describe 'DELETE #destroy' do | ||
it 'destroys the requested transaction_detail' do | ||
expect do | ||
delete :destroy, params: { id: transaction_detail.id } | ||
end.to change(TransactionDetail, :count).by(0) | ||
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,47 +1,52 @@ | ||
example_id | status | run_time | | ||
------------------------------------------------------------ | ------ | --------------- | | ||
./spec/controllers/categories_controller_spec.rb[1:1:1] | passed | 0.5563 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:2:1] | passed | 0.03806 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:3:1:1] | passed | 0.04594 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:3:1:2] | passed | 0.03319 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:3:2:1] | passed | 0.02793 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:4:1:1] | passed | 0.02859 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:4:1:2] | passed | 0.03089 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:4:2:1] | passed | 0.02773 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:5:1] | passed | 0.0308 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:5:2] | passed | 0.02746 seconds | | ||
./spec/models/category_spec.rb[1:1] | passed | 0.47169 seconds | | ||
./spec/models/category_spec.rb[1:2] | passed | 0.01377 seconds | | ||
./spec/models/category_spec.rb[1:3] | passed | 0.01547 seconds | | ||
./spec/models/category_spec.rb[1:4] | passed | 0.01538 seconds | | ||
./spec/models/category_spec.rb[1:5:1] | passed | 0.07821 seconds | | ||
./spec/models/transaction_detail_spec.rb[1:1] | passed | 0.0148 seconds | | ||
./spec/models/transaction_detail_spec.rb[1:2] | passed | 0.02004 seconds | | ||
./spec/models/transaction_detail_spec.rb[1:3] | passed | 0.0218 seconds | | ||
./spec/models/transaction_detail_spec.rb[1:4] | passed | 0.01279 seconds | | ||
./spec/models/user_spec.rb[1:1:1] | passed | 0.01018 seconds | | ||
./spec/models/user_spec.rb[1:1:2:1] | passed | 0.01241 seconds | | ||
./spec/models/user_spec.rb[1:1:3:1] | passed | 0.01055 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:1] | passed | 0.01427 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:2] | passed | 0.00891 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:3] | passed | 0.01014 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:4] | passed | 0.0038 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:5] | passed | 0.00337 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:6] | passed | 0.00252 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:7] | passed | 0.00359 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:8] | passed | 0.01188 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:1] | passed | 0.00274 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:2] | passed | 0.00575 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:3] | passed | 0.00335 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:4] | passed | 0.0054 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:5] | passed | 0.00566 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:6] | passed | 0.00454 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:7] | passed | 0.00508 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:8] | passed | 0.00486 seconds | | ||
./spec/views/categories/new.html.erb_spec.rb[1:1] | passed | 4.16 seconds | | ||
./spec/views/categories/new.html.erb_spec.rb[1:2] | passed | 1.87 seconds | | ||
./spec/views/devise/registration/new.html.erb_spec.rb[1:1:1] | passed | 4.8 seconds | | ||
./spec/views/devise/sessions/new.html.erb_spec.rb[1:1:1] | passed | 1.16 seconds | | ||
./spec/views/home/index.html.erb_spec.rb[1:1] | passed | 2.8 seconds | | ||
./spec/views/home/index.html.erb_spec.rb[1:2] | passed | 0.606 seconds | | ||
./spec/views/home/index.html.erb_spec.rb[1:3] | passed | 0.49981 seconds | | ||
example_id | status | run_time | | ||
------------------------------------------------------------------ | ------ | --------------- | | ||
./spec/controllers/categories_controller_spec.rb[1:1:1] | passed | 0.5563 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:2:1] | passed | 0.03806 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:3:1:1] | passed | 0.04594 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:3:1:2] | passed | 0.03319 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:3:2:1] | passed | 0.02793 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:4:1:1] | passed | 0.02859 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:4:1:2] | passed | 0.03089 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:4:2:1] | passed | 0.02773 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:5:1] | passed | 0.0308 seconds | | ||
./spec/controllers/categories_controller_spec.rb[1:5:2] | passed | 0.02746 seconds | | ||
./spec/controllers/transaction_details_controller_spec.rb[1:1:1] | passed | 0.49889 seconds | | ||
./spec/controllers/transaction_details_controller_spec.rb[1:2:1:1] | passed | 0.0552 seconds | | ||
./spec/controllers/transaction_details_controller_spec.rb[1:3:1] | passed | 0.01962 seconds | | ||
./spec/models/category_spec.rb[1:1] | passed | 0.47169 seconds | | ||
./spec/models/category_spec.rb[1:2] | passed | 0.01377 seconds | | ||
./spec/models/category_spec.rb[1:3] | passed | 0.01547 seconds | | ||
./spec/models/category_spec.rb[1:4] | passed | 0.01538 seconds | | ||
./spec/models/category_spec.rb[1:5:1] | passed | 0.07821 seconds | | ||
./spec/models/transaction_detail_spec.rb[1:1] | passed | 0.0148 seconds | | ||
./spec/models/transaction_detail_spec.rb[1:2] | passed | 0.02004 seconds | | ||
./spec/models/transaction_detail_spec.rb[1:3] | passed | 0.0218 seconds | | ||
./spec/models/transaction_detail_spec.rb[1:4] | passed | 0.01279 seconds | | ||
./spec/models/user_spec.rb[1:1:1] | passed | 0.01018 seconds | | ||
./spec/models/user_spec.rb[1:1:2:1] | passed | 0.01241 seconds | | ||
./spec/models/user_spec.rb[1:1:3:1] | passed | 0.01055 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:1] | passed | 0.01427 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:2] | passed | 0.00891 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:3] | passed | 0.01014 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:4] | passed | 0.0038 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:5] | passed | 0.00337 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:6] | passed | 0.00252 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:7] | passed | 0.00359 seconds | | ||
./spec/routing/categories_routing_spec.rb[1:1:8] | passed | 0.01188 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:1] | passed | 0.00274 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:2] | passed | 0.00575 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:3] | passed | 0.00335 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:4] | passed | 0.0054 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:5] | passed | 0.00566 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:6] | passed | 0.00454 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:7] | passed | 0.00508 seconds | | ||
./spec/routing/transaction_details_routing_spec.rb[1:1:8] | passed | 0.00486 seconds | | ||
./spec/views/categories/new.html.erb_spec.rb[1:1] | passed | 4.16 seconds | | ||
./spec/views/categories/new.html.erb_spec.rb[1:2] | passed | 1.87 seconds | | ||
./spec/views/devise/registration/new.html.erb_spec.rb[1:1:1] | passed | 4.8 seconds | | ||
./spec/views/devise/sessions/new.html.erb_spec.rb[1:1:1] | passed | 1.16 seconds | | ||
./spec/views/home/index.html.erb_spec.rb[1:1] | passed | 2.8 seconds | | ||
./spec/views/home/index.html.erb_spec.rb[1:2] | passed | 0.606 seconds | | ||
./spec/views/home/index.html.erb_spec.rb[1:3] | passed | 0.49981 seconds | | ||
./spec/views/transaction_details/new.html.erb_spec.rb[1:1] | passed | 4.47 seconds | | ||
./spec/views/transaction_details/new.html.erb_spec.rb[1:2] | passed | 2.24 seconds | |
Oops, something went wrong.