Skip to content

Commit

Permalink
Merge branch 'develop' into add_simplecov
Browse files Browse the repository at this point in the history
  • Loading branch information
markets committed Mar 9, 2019
2 parents b6b6085 + cf3bcb2 commit b7679e1
Show file tree
Hide file tree
Showing 21 changed files with 148 additions and 135 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
¿Has encontrado algún bug? ¿Quieres colaborar?

Proceso:
* Abrir un hilo en [discourse](http://community.coopdevs.org/) para aclarar si es un bug o una feature :wink:
* Una vez aclarado el bug y detectado los pasos para reproducirlos se crearia una issue en GH con enlaze al hilo original en discourse.
* Abrir un hilo en [discourse](https://community.coopdevs.org/c/timeoverflow) para aclarar si es un bug o una feature :wink:
* Una vez aclarado, si se trata de un bug, abre una issue en Github indicando los pasos para reproducirlo y cómo debería funncionar correctamente, enlaza al hilo original en discourse.
* Pull request que resuelve la issue.
* Reportar en el hilo de discourse que el bug ha sido resuelto con enlace a PR.

Expand Down
12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ group :development do
gem 'airbrussh', require: false
gem 'localeapp', '2.1.1', require: false
gem 'letter_opener', '1.4.1'
gem 'dotenv-rails', '2.5.0'
gem 'dotenv-rails', '~> 2.7.1'
end

group :development, :test do
gem "rspec-rails", '~> 3.7.2'
gem "byebug"
end

group :test do
gem "rspec-rails", '~> 3.8.2'
gem "database_cleaner", '1.6.2'
gem 'shoulda-matchers', '~> 3.1.2'
gem 'fabrication'
gem 'faker'
gem 'capybara', '~> 2.7'
gem 'capybara-selenium', '~> 0.0.6'
gem 'chromedriver-helper', '~> 1.0'
gem 'faker', '~> 1.9'
gem 'capybara', '~> 3.13'
gem 'selenium-webdriver', '~> 3.141'
gem 'chromedriver-helper', '~> 2.1'
gem 'simplecov', '~> 0.16.1', require: false
end

Expand Down
145 changes: 72 additions & 73 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
actionmailer (4.2.11)
actionpack (= 4.2.11)
actionview (= 4.2.11)
activejob (= 4.2.11)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.10)
actionview (= 4.2.10)
activesupport (= 4.2.10)
actionpack (4.2.11)
actionview (= 4.2.11)
activesupport (= 4.2.11)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.10)
activesupport (= 4.2.10)
actionview (4.2.11)
activesupport (= 4.2.11)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
Expand All @@ -32,17 +32,17 @@ GEM
ransack (~> 1.3)
sass (~> 3.1)
sprockets (< 4.1)
activejob (4.2.10)
activesupport (= 4.2.10)
activejob (4.2.11)
activesupport (= 4.2.11)
globalid (>= 0.3.0)
activemodel (4.2.10)
activesupport (= 4.2.10)
activemodel (4.2.11)
activesupport (= 4.2.11)
builder (~> 3.1)
activerecord (4.2.10)
activemodel (= 4.2.10)
activesupport (= 4.2.10)
activerecord (4.2.11)
activemodel (= 4.2.11)
activesupport (= 4.2.11)
arel (~> 6.0)
activesupport (4.2.10)
activesupport (4.2.11)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
Expand Down Expand Up @@ -86,19 +86,17 @@ GEM
capistrano-rbenv (2.1.3)
capistrano (~> 3.1)
sshkit (~> 1.3)
capybara (2.18.0)
capybara (3.13.2)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (>= 2.0, < 4.0)
capybara-selenium (0.0.6)
capybara
selenium-webdriver
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.2)
xpath (~> 3.2)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (1.2.0)
chromedriver-helper (2.1.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
chronic (0.10.2)
Expand All @@ -111,7 +109,7 @@ GEM
execjs
coffee-script-source (1.8.0)
columnize (0.9.0)
concurrent-ruby (1.0.5)
concurrent-ruby (1.1.3)
connection_pool (2.2.1)
crass (1.0.4)
dalli (2.7.2)
Expand All @@ -127,10 +125,10 @@ GEM
docile (1.3.1)
domain_name (0.5.20170223)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.5.0)
dotenv-rails (2.5.0)
dotenv (= 2.5.0)
railties (>= 3.2, < 6.0)
dotenv (2.7.1)
dotenv-rails (2.7.1)
dotenv (= 2.7.1)
railties (>= 3.2, < 6.1)
elasticsearch (1.0.8)
elasticsearch-api (= 1.0.7)
elasticsearch-transport (= 1.0.7)
Expand All @@ -150,11 +148,11 @@ GEM
tzinfo
execjs (2.6.0)
fabrication (2.11.3)
faker (1.4.3)
i18n (~> 0.5)
faker (1.9.3)
i18n (>= 0.7)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
ffi (1.9.25)
ffi (1.10.0)
formtastic (3.1.5)
actionpack (>= 3.2.13)
formtastic_i18n (0.6.0)
Expand Down Expand Up @@ -205,15 +203,15 @@ GEM
i18n (~> 0.4)
json
rest-client
loofah (2.2.2)
loofah (2.2.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mail (2.7.1)
mini_mime (>= 0.1.1)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_mime (1.0.0)
mini_mime (1.0.1)
mini_portile2 (2.3.0)
minitest (5.11.3)
multi_json (1.11.2)
Expand All @@ -222,7 +220,7 @@ GEM
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
netrc (0.11.0)
nokogiri (1.8.4)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
orm_adapter (0.5.0)
parallel (1.12.1)
Expand All @@ -241,21 +239,21 @@ GEM
public_suffix (2.0.5)
pundit (2.0.0)
activesupport (>= 3.0.0)
rack (1.6.10)
rack (1.6.11)
rack-protection (2.0.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.10)
actionmailer (= 4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
activemodel (= 4.2.10)
activerecord (= 4.2.10)
activesupport (= 4.2.10)
rails (4.2.11)
actionmailer (= 4.2.11)
actionpack (= 4.2.11)
actionview (= 4.2.11)
activejob (= 4.2.11)
activemodel (= 4.2.11)
activerecord (= 4.2.11)
activesupport (= 4.2.11)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.10)
railties (= 4.2.11)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
Expand All @@ -273,9 +271,9 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.3)
rails_stdout_logging (0.0.3)
railties (4.2.10)
actionpack (= 4.2.10)
activesupport (= 4.2.10)
railties (4.2.11)
actionpack (= 4.2.11)
activesupport (= 4.2.11)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
Expand All @@ -289,6 +287,7 @@ GEM
polyamorous (~> 1.3.2)
rdiscount (2.1.7.1)
redis (4.0.1)
regexp_parser (1.3.0)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
Expand All @@ -298,23 +297,23 @@ GEM
netrc (~> 0.8)
rollbar (2.8.3)
multi_json
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-rails (3.7.2)
rspec-support (~> 3.8.0)
rspec-rails (3.8.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.52.1)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
Expand All @@ -335,9 +334,9 @@ GEM
tilt (>= 1.1, < 3)
select2-rails (4.0.1)
thor (~> 0.14)
selenium-webdriver (3.11.0)
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2)
rubyzip (~> 1.2, >= 1.2.2)
shoulda-matchers (3.1.2)
activesupport (>= 4.0.0)
sidekiq (5.1.3)
Expand Down Expand Up @@ -370,7 +369,7 @@ GEM
sshkit (1.8.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
thor (0.20.0)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.8)
ttfunk (1.5.1)
Expand All @@ -396,7 +395,7 @@ GEM
sprockets-rails (>= 2.0, < 4.0)
whenever (0.9.4)
chronic (>= 0.6.3)
xpath (3.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)

PLATFORMS
Expand All @@ -412,18 +411,17 @@ DEPENDENCIES
capistrano (~> 3.1)
capistrano-rails (~> 1.1)
capistrano-rbenv (~> 2.1)
capybara (~> 2.7)
capybara-selenium (~> 0.0.6)
chromedriver-helper (~> 1.0)
capybara (~> 3.13)
chromedriver-helper (~> 2.1)
coffee-rails
dalli
database_cleaner (= 1.6.2)
devise (~> 4.5.0)
dotenv-rails (= 2.5.0)
dotenv-rails (~> 2.7.1)
elasticsearch-model
elasticsearch-rails
fabrication
faker
faker (~> 1.9)
has_scope
hstore_translate
http_accept_language (~> 2.1.1)
Expand All @@ -440,11 +438,12 @@ DEPENDENCIES
rails_12factor (= 0.0.3)
rdiscount
rollbar (= 2.8.3)
rspec-rails (~> 3.7.2)
rspec-rails (~> 3.8.2)
rubocop (~> 0.52.1)
rufus-scheduler (~> 3.4.2)
sass-rails (~> 5.0.7)
select2-rails
selenium-webdriver (~> 3.141)
shoulda-matchers (~> 3.1.2)
sidekiq (= 5.1.3)
sidekiq-cron (= 0.6.3)
Expand Down
9 changes: 7 additions & 2 deletions app/assets/javascripts/give_time.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ jQuery.validator.addMethod "either-hours-minutes-informed", ((value, element) ->
giveTimeReadyFn = () ->
config =
submitHandler: (form) ->
$(" #transfer_amount ").val($(" #transfer_hours ").val() * 3600 + $(" #transfer_minutes ").val() * 60)
form.submit()
amount = $("#transfer_hours").val() * 3600 + $("#transfer_minutes").val() * 60
$("#transfer_amount").val(amount)

if amount > 0
form.submit()
else
$(form).find('.form-actions .error').removeClass('invisible').show()

$( "#new_transfer" ).validate(config)

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/transfers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def create
if persister.save
redirect_to redirect_target
else
flash[:error] = transfer.errors.full_messages.to_sentence
redirect_to :back, alert: transfer.errors.full_messages.to_sentence
end
end

Expand Down
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ module ApplicationHelper
TEXT_SUCCESS = 'text-success'.freeze
TEXT_DANGER = 'text-danger'.freeze

def page_title
current_organization || 'TimeOverflow'
end

# from gravatar
def avatar_url(user, size = 32)
gravatar_id = Digest::MD5::hexdigest(user.email).downcase
Expand Down
2 changes: 2 additions & 0 deletions app/models/movement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class Movement < ActiveRecord::Base
where(created_at: month.beginning_of_month..month.end_of_month)
}

validates :amount, numericality: { other_than: 0 }

after_create do
account.update_balance
end
Expand Down
Loading

0 comments on commit b7679e1

Please sign in to comment.