Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Commit

Permalink
Merge pull request #187 from zincmade/primary
Browse files Browse the repository at this point in the history
Release 1.2.0.rc2
  • Loading branch information
zspencer committed Mar 23, 2016
2 parents 98b4799 + 76091e4 commit a88c0ba
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.4
2.3.0
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

ruby "2.2.4"
ruby "2.3.0"

gem "rails", "~> 4.2"

Expand Down
82 changes: 41 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.5.1)
actionpack (= 4.2.5.1)
actionview (= 4.2.5.1)
activejob (= 4.2.5.1)
actionmailer (4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.5.1)
actionview (= 4.2.5.1)
activesupport (= 4.2.5.1)
actionpack (4.2.6)
actionview (= 4.2.6)
activesupport (= 4.2.6)
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.5.1)
activesupport (= 4.2.5.1)
actionview (4.2.6)
activesupport (= 4.2.6)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.5.1)
activesupport (= 4.2.5.1)
activejob (4.2.6)
activesupport (= 4.2.6)
globalid (>= 0.3.0)
activemodel (4.2.5.1)
activesupport (= 4.2.5.1)
activemodel (4.2.6)
activesupport (= 4.2.6)
builder (~> 3.1)
activerecord (4.2.5.1)
activemodel (= 4.2.5.1)
activesupport (= 4.2.5.1)
activerecord (4.2.6)
activemodel (= 4.2.6)
activesupport (= 4.2.6)
arel (~> 6.0)
activesupport (4.2.5.1)
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
Expand All @@ -43,7 +43,7 @@ GEM
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.10)
bcrypt (3.1.11)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bitters (1.2.0)
Expand All @@ -66,13 +66,13 @@ GEM
capybara-screenshot (1.0.11)
capybara (>= 1.0, < 3)
launchy
codeclimate-test-reporter (0.4.8)
codeclimate-test-reporter (0.5.0)
simplecov (>= 0.7.1, < 1.0.0)
coderay (1.1.0)
coderay (1.1.1)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
columnize (0.9.0)
concurrent-ruby (1.0.0)
concurrent-ruby (1.0.1)
debug_inspector (0.0.2)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
Expand Down Expand Up @@ -110,8 +110,8 @@ GEM
tilt
i18n (0.7.0)
ice_nine (0.11.2)
jquery-rails (4.1.0)
rails-dom-testing (~> 1.0)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.5)
Expand All @@ -124,10 +124,10 @@ GEM
mail (2.6.3)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
mime-types (2.99)
mime-types (2.99.1)
mini_portile2 (2.0.0)
minitest (5.8.4)
neat (1.7.2)
neat (1.7.4)
bourbon (>= 4.0)
sass (>= 3.3)
nokogiri (1.6.7.2)
Expand All @@ -150,16 +150,16 @@ GEM
rack-test (0.6.3)
rack (>= 1.0)
rack-timeout (0.3.2)
rails (4.2.5.1)
actionmailer (= 4.2.5.1)
actionpack (= 4.2.5.1)
actionview (= 4.2.5.1)
activejob (= 4.2.5.1)
activemodel (= 4.2.5.1)
activerecord (= 4.2.5.1)
activesupport (= 4.2.5.1)
rails (4.2.6)
actionmailer (= 4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
activemodel (= 4.2.6)
activerecord (= 4.2.6)
activesupport (= 4.2.6)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.5.1)
railties (= 4.2.6)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
Expand All @@ -174,17 +174,17 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.4)
railties (4.2.5.1)
actionpack (= 4.2.5.1)
activesupport (= 4.2.5.1)
railties (4.2.6)
actionpack (= 4.2.6)
activesupport (= 4.2.6)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.1.0)
rake (10.5.0)
rake (11.1.1)
rdoc (4.2.2)
json (~> 1.4)
request_store (1.3.0)
responders (2.1.1)
responders (2.1.2)
railties (>= 4.2.0, < 5.1)
rspec (3.4.0)
rspec-core (~> 3.4.0)
Expand Down Expand Up @@ -237,11 +237,11 @@ GEM
simplecov-html (0.10.0)
slop (3.6.0)
sorcerer (1.0.2)
spring (1.6.3)
spring (1.6.4)
sprockets (3.5.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.0.1)
sprockets-rails (3.0.4)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
Expand Down
6 changes: 6 additions & 0 deletions app/controllers/check_ins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def create
@check_in = CheckIn.new(check_in_params)
if @check_in.save
flash[:notice] = "check in created!"
track_check_in_creation(@check_in)
redirect_to root_path
else
render :new
Expand Down Expand Up @@ -46,4 +47,9 @@ def create
:notes,
:activity_id]]
end

private def track_check_in_creation(check_in)
track_event("Check in created", log_count: check_in.logs.count,
worked_at: check_in.logs.first.worked_at)
end
end
2 changes: 1 addition & 1 deletion app/models/check_in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def log_entries_attributes=(log_entries_attributes)
end

def log_entries
Activity.all.map do |activity|
Activity.active.map do |activity|
logs.new(activity: activity)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/logs/_form.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
<%= f.text_area :notes %>
<%= render partial: "error_for_field", locals: { model: @log, field: :notes } %>

<%= f.submit "Log Capacity" %>
<%= f.submit "Track Activity" %>
<%= link_to "Return To Dashboard", root_path %>
<%- end %>
4 changes: 2 additions & 2 deletions bin/bundle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
load Gem.bin_path("bundler", "bundle")
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')
10 changes: 3 additions & 7 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
APP_PATH = File.expand_path("../../config/application", __FILE__)
require_relative "../config/boot"
require "rails/commands"
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
8 changes: 2 additions & 6 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require_relative "../config/boot"
require "rake"
require_relative '../config/boot'
require 'rake'
Rake.application.run
4 changes: 2 additions & 2 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
require "pathname"
require 'pathname'

# path to your application root.
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__)
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)

Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
Expand Down
5 changes: 5 additions & 0 deletions spec/factories/activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@
weekly_burn_rate 4
billable true
owner

factory :archived_activity do
sequence(:name) { |i| "Archived Activity #{i}" }
active false
end
end
end
39 changes: 25 additions & 14 deletions spec/features/checking_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,34 @@ def fill_in_notes(activity, content)
Given!(:work_activity) { FactoryGirl.create(:activity, name: "Do Work") }

When { click_link_or_button "Check In" }
When { fill_in("What day is this for?", with: worked_at) }

When { select_quantity(fun_activity, "1~2 hours") }
When { fill_in_notes(fun_activity, "SO MUCH FUN") }
When { select_quality(fun_activity, "Great! It was Like I was super powered!") }
describe "Logging a bunch of activities" do
When { fill_in("What day is this for?", with: worked_at) }

When { select_quantity(work_activity, "4~6 hours") }
When { fill_in_notes(work_activity, "DID SO MUCH") }
When { select_quality(work_activity, "Good! I was REALLY focused") }
When { select_quantity(fun_activity, "1~2 hours") }
When { fill_in_notes(fun_activity, "SO MUCH FUN") }
When { select_quality(fun_activity, "Great! It was Like I was super powered!") }

When { click_link_or_button("Create Check in") }
When { select_quantity(work_activity, "4~6 hours") }
When { fill_in_notes(work_activity, "DID SO MUCH") }
When { select_quality(work_activity, "Good! I was REALLY focused") }

Then { work_log_entry.notes == "DID SO MUCH" }
Then { work_log_entry.quality == 3 }
Then { work_log_entry.amount == 6 }
When { click_link_or_button("Create Check in") }

Then { fun_log_entry.notes == "SO MUCH FUN" }
Then { fun_log_entry.quality == 4 }
Then { fun_log_entry.amount == 2 }
Then { work_log_entry.notes == "DID SO MUCH" }
Then { work_log_entry.quality == 3 }
Then { work_log_entry.amount == 6 }

Then { fun_log_entry.notes == "SO MUCH FUN" }
Then { fun_log_entry.quality == 4 }
Then { fun_log_entry.amount == 2 }
end

describe "Archived activities" do
Given!(:archived_activity) { FactoryGirl.create(:archived_activity) }

Then { expect(page).not_to have_content(archived_activity.name) }
Then { expect(activity_div(fun_activity)).to be_present }
Then { expect(activity_div(work_activity)).to be_present }
end
end
6 changes: 3 additions & 3 deletions spec/features/logging_time_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
When { fill_in("Worked at", with: worked_at) }

context "when tracking time as billable" do
When { click_link_or_button("Log Capacity") }
When { click_link_or_button("Track Activity") }
Then { expect(log.do_not_bill).to be(false) }
Then { expect(log).to be_persisted }
end

context "when tracking time as do not bill" do
When { check("Do Not Bill") }
When { click_link_or_button("Log Capacity") }
When { click_link_or_button("Track Activity") }
Then { expect(log.do_not_bill).to be(true) }
Then { expect(log).to be_persisted }
end
Expand All @@ -37,6 +37,6 @@

When { within("##{decorated_log.dom_id}") { click_link_or_button("Edit") } }
When { select("😄", from: "How'd it go?") }
When { click_link_or_button("Log Capacity") }
When { click_link_or_button("Track Activity") }
Then { expect(log.reload.quality).to eql(5) }
end

0 comments on commit a88c0ba

Please sign in to comment.