Skip to content

Development finished #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a786134
Init app
abdelp Apr 20, 2021
38601c4
Downgrade pg gem to avoid errors
abdelp Apr 20, 2021
ae20312
Update db credentials (not a good practice for production)
abdelp Apr 20, 2021
e4547a8
Add customers scaffold
abdelp Apr 20, 2021
faeb99f
Add CreditCards scaffold
abdelp Apr 20, 2021
11d1ffc
Migrate CreditCards
abdelp Apr 20, 2021
45980d1
Add seeds
abdelp Apr 20, 2021
98b797c
Remove CreditCards scaffold to rename it Transactions
abdelp Apr 20, 2021
5305227
Migrate customers and transactions
abdelp Apr 20, 2021
b2ad544
Remove and recreate customers scaffold to not use camelCase for its c…
abdelp Apr 20, 2021
b360126
Add default value for Transactions
abdelp Apr 20, 2021
fbfd0e4
Remove default value from transaction created in schema
abdelp Apr 20, 2021
7dd243c
Downgrade turbolinks to avoid include NoMethodError
abdelp Apr 20, 2021
6e8e5a8
Rename Transactions to Charges
abdelp Apr 20, 2021
b06c827
Add charge scopes for failed, disputed, successful
abdelp Apr 20, 2021
0db1296
Add charge partial
abdelp Apr 20, 2021
1e2169c
Add charges partial
abdelp Apr 20, 2021
e258aa2
Update table for charges partial instead
abdelp Apr 20, 2021
e7823fc
Add and install rspec 3.10
abdelp Apr 20, 2021
10bfd8e
Update seeds to containt failed, disputed and successful charges
abdelp Apr 20, 2021
37515f5
Update rspec-core 3.10 gem to rspec-core 3.9
abdelp Apr 20, 2021
3895bc1
Add id to charges partial
abdelp Apr 20, 2021
034a788
Install rspec-rails
abdelp Apr 20, 2021
49afed8
Init app
abdelp Apr 20, 2021
e7d270c
Add RSpec configuration
abdelp Apr 20, 2021
3538891
Update database credentials (not safe)
abdelp Apr 20, 2021
0f51d68
Add customers scaffold
abdelp Apr 20, 2021
6bfcf8b
Add charges scaffold
abdelp Apr 20, 2021
86560f8
Add and Update gems for RSpec testing
abdelp Apr 20, 2021
d60b648
Update charges scaffold
abdelp Apr 20, 2021
767c34a
Update scopes syntax
abdelp Apr 20, 2021
d937d59
Add class to charge partial to use it in RSpec tests
abdelp Apr 20, 2021
11f2793
Change the seeds to make them fit differente types of transactions as…
abdelp Apr 20, 2021
642ed23
Add more default values and constraints to models
abdelp Apr 20, 2021
f097556
Add assertion test as required
abdelp Apr 20, 2021
ad6f000
Add clarifications
abdelp Apr 20, 2021
1bed94f
Add danger and salmon class styling
abdelp Apr 20, 2021
e64abda
Separate unsuccessful charges partials from the successful ones
abdelp Apr 20, 2021
46edc33
Remove previous version of project
abdelp Apr 20, 2021
1a1e10a
Add helpers
abdelp Apr 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions source/example-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
51 changes: 51 additions & 0 deletions source/example-app/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

# Use postgresql as the database for Active Record
gem 'pg', '~> 0.20.0'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks', '~> 1.3'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end

group :development, :test do
gem 'rspec-rails', '~> 3.9.1'
gem 'database_cleaner', '1.8.3'
gem 'capybara'
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]
157 changes: 157 additions & 0 deletions source/example-app/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.0)
actionpack (= 4.0.0)
mail (~> 2.5.3)
actionpack (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
activerecord (4.0.0)
activemodel (= 4.0.0)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.0)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.4)
activesupport (4.0.0)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
arel (4.0.2)
builder (3.1.4)
capybara (2.18.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (>= 2.0, < 4.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.8)
database_cleaner (1.8.3)
diff-lcs (1.4.4)
erubis (2.7.0)
execjs (2.7.0)
hike (1.2.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jbuilder (1.5.3)
activesupport (>= 3.0.0)
multi_json (>= 1.2.0)
jquery-rails (3.1.5)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
mail (2.5.5)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
mini_mime (1.1.0)
mini_portile2 (2.1.0)
minitest (4.7.5)
multi_json (1.15.0)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
pg (0.20.0)
polyglot (0.3.5)
public_suffix (2.0.5)
rack (1.5.5)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.0.0)
actionmailer (= 4.0.0)
actionpack (= 4.0.0)
activerecord (= 4.0.0)
activesupport (= 4.0.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.0)
sprockets-rails (~> 2.0.0)
railties (4.0.0)
actionpack (= 4.0.0)
activesupport (= 4.0.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.3.3)
rdoc (5.1.0)
rspec-core (3.9.3)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-rails (3.9.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.4)
sass (3.2.19)
sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.2)
sprockets (~> 2.8, < 3.0)
sprockets-rails (~> 2.0)
sdoc (2.1.0)
rdoc (>= 5.0)
sprockets (2.12.5)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
thor (1.1.0)
thread_safe (0.3.6)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (1.3.1)
coffee-rails
tzinfo (0.3.60)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
xpath (2.1.0)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
capybara
coffee-rails (~> 4.0.0)
database_cleaner (= 1.8.3)
jbuilder (~> 1.2)
jquery-rails
pg (~> 0.20.0)
rails (= 4.0.0)
rspec-rails (~> 3.9.1)
sass-rails (~> 4.0.0)
sdoc
turbolinks (~> 1.3)
uglifier (>= 1.3.0)

BUNDLED WITH
1.17.3
28 changes: 28 additions & 0 deletions source/example-app/README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
== README

This README would normally document whatever steps are necessary to get the
application up and running.

Things you may want to cover:

* Ruby version

* System dependencies

* Configuration

* Database creation

* Database initialization

* How to run the test suite

* Services (job queues, cache servers, search engines, etc.)

* Deployment instructions

* ...


Please feel free to use a different markup language if you do not plan to run
<tt>rake doc:app</tt>.
6 changes: 6 additions & 0 deletions source/example-app/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)

ExampleApp::Application.load_tasks
Empty file.
16 changes: 16 additions & 0 deletions source/example-app/app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
3 changes: 3 additions & 0 deletions source/example-app/app/assets/javascripts/charges.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions source/example-app/app/assets/javascripts/customers.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
21 changes: 21 additions & 0 deletions source/example-app/app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/

.danger {
background-color: #FF0000;
}

.salmon {
background-color: #FF5400;
}
3 changes: 3 additions & 0 deletions source/example-app/app/assets/stylesheets/charges.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the Charges controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions source/example-app/app/assets/stylesheets/customers.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the customers controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
69 changes: 69 additions & 0 deletions source/example-app/app/assets/stylesheets/scaffolds.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
body {
background-color: #fff;
color: #333;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}

p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}

pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}

a {
color: #000;
&:visited {
color: #666;
}
&:hover {
color: #fff;
background-color: #000;
}
}

div {
&.field, &.actions {
margin-bottom: 10px;
}
}

#notice {
color: green;
}

.field_with_errors {
padding: 2px;
background-color: red;
display: table;
}

#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px;
padding-bottom: 0;
margin-bottom: 20px;
background-color: #f0f0f0;
h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
margin-bottom: 0px;
background-color: #c00;
color: #fff;
}
ul li {
font-size: 12px;
list-style: square;
}
}
5 changes: 5 additions & 0 deletions source/example-app/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
Loading