gamification 0.0.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/gamification/application_controller.rb +1 -1
  3. data/app/controllers/gamification/rewards_controller.rb +46 -0
  4. data/app/helpers/gamification/application_helper.rb +24 -0
  5. data/app/helpers/gamification/rewards_helper.rb +20 -0
  6. data/app/models/gamification/goal.rb +5 -0
  7. data/app/models/gamification/medal.rb +5 -0
  8. data/app/models/gamification/reward.rb +5 -0
  9. data/app/uploaders/gamification/image_uploader.rb +47 -0
  10. data/app/views/gamification/rewards/_presentation.html.erb +7 -0
  11. data/app/views/gamification/rewards/_reward.html.erb +9 -0
  12. data/app/views/gamification/scorings/create.html.erb +2 -0
  13. data/config/initializers/routing.rb +15 -0
  14. data/config/locales/en.yml +3 -0
  15. data/config/locales/nb.yml +35 -0
  16. data/config/routes.rb +1 -0
  17. data/db/migrate/20140310081749_rename_everything.rb +10 -0
  18. data/db/migrate/20140313134259_create_gamification_medals.rb +11 -0
  19. data/db/migrate/20140314132611_add_description_to_gamification_medals.rb +5 -0
  20. data/db/migrate/20140315142524_rename_gamification_tasks_to_goals.rb +7 -0
  21. data/db/migrate/20140318220723_add_seen_at_to_gamification_rewards.rb +9 -0
  22. data/lib/gamification.rb +1 -0
  23. data/lib/gamification/activerecord.rb +13 -0
  24. data/lib/gamification/concerns.rb +2 -0
  25. data/lib/gamification/concerns/models.rb +3 -2
  26. data/lib/gamification/concerns/models/goal.rb +44 -0
  27. data/lib/gamification/concerns/models/medal.rb +13 -0
  28. data/lib/gamification/concerns/models/reward.rb +33 -0
  29. data/lib/gamification/concerns/rewardable.rb +12 -0
  30. data/lib/gamification/concerns/rewarding.rb +7 -0
  31. data/lib/gamification/engine.rb +10 -0
  32. data/lib/gamification/version.rb +1 -1
  33. data/spec/controllers/gamification/rewards_controller_spec.rb +57 -0
  34. data/spec/dummy/app/assets/javascripts/articles.js +2 -0
  35. data/spec/dummy/app/assets/stylesheets/articles.css +4 -0
  36. data/spec/dummy/app/controllers/articles_controller.rb +5 -0
  37. data/spec/dummy/app/helpers/articles_helper.rb +2 -0
  38. data/spec/dummy/app/models/article.rb +2 -2
  39. data/spec/dummy/app/models/user.rb +2 -2
  40. data/spec/dummy/app/views/articles/show.html.erb +1 -0
  41. data/spec/dummy/config/routes.rb +1 -0
  42. data/spec/dummy/db/development.sqlite3 +0 -0
  43. data/spec/dummy/db/schema.rb +25 -12
  44. data/spec/dummy/db/test.sqlite3 +0 -0
  45. data/spec/dummy/log/development.log +3893 -1707
  46. data/spec/dummy/log/test.log +22080 -2888
  47. data/spec/dummy/spec/controllers/articles_controller_spec.rb +15 -0
  48. data/spec/dummy/spec/helpers/articles_helper_spec.rb +14 -0
  49. data/spec/dummy/spec/models/article_spec.rb +0 -1
  50. data/spec/dummy/spec/models/user_spec.rb +0 -1
  51. data/spec/dummy/spec/views/articles/show.html.erb_spec.rb +4 -0
  52. data/spec/factories/gamification_goals.rb +14 -0
  53. data/spec/factories/gamification_medals.rb +10 -0
  54. data/spec/factories/gamification_rewards.rb +8 -0
  55. data/spec/helpers/gamification/application_helper_spec.rb +14 -0
  56. data/spec/helpers/gamification/rewards_helper_spec.rb +18 -0
  57. data/spec/lib/gamification/concerns/rewardable_spec.rb +17 -0
  58. data/spec/models/gamification/goal_spec.rb +65 -0
  59. data/spec/models/gamification/medal_spec.rb +6 -0
  60. data/spec/models/gamification/reward_spec.rb +102 -0
  61. data/spec/spec_helper.rb +2 -0
  62. data/spec/views/gamification/rewards/_presentation.html.erb_spec.rb +23 -0
  63. metadata +173 -28
  64. data/MIT-LICENSE +0 -20
  65. data/app/models/gamification/scoring.rb +0 -5
  66. data/app/models/gamification/task.rb +0 -5
  67. data/app/views/layouts/gamification/application.html.erb +0 -14
  68. data/lib/gamification/concerns/models/scoring.rb +0 -8
  69. data/lib/gamification/concerns/models/task.rb +0 -50
  70. data/spec/factories/gamification_scorings.rb +0 -8
  71. data/spec/factories/gamification_tasks.rb +0 -8
  72. data/spec/models/gamification/scoring_spec.rb +0 -7
  73. data/spec/models/gamification/task_spec.rb +0 -77
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe ArticlesController do
4
+
5
+ describe "GET 'show'" do
6
+ let(:article) { create :article }
7
+
8
+ it 'returns http success' do
9
+ get 'show', id: article.id
10
+
11
+ response.should be_success
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ # Specs in this file have access to a helper object that includes
4
+ # the ArticlesHelper. For example:
5
+ #
6
+ # describe ArticlesHelper do
7
+ # describe "string concat" do
8
+ # it "concats two strings with spaces" do
9
+ # expect(helper.concat_strings("this","that")).to eq("this that")
10
+ # end
11
+ # end
12
+ # end
13
+ describe ArticlesHelper do
14
+ end
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Article do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
4
  end
@@ -1,5 +1,4 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe User do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
4
  end
@@ -0,0 +1,4 @@
1
+ require 'spec_helper'
2
+
3
+ describe "articles/show.html.erb" do
4
+ end
@@ -0,0 +1,14 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :gamification_goal, aliases: [:goal], class: 'Gamification::Goal' do
5
+ rewarding nil
6
+ points 1
7
+
8
+ trait :with_medal do
9
+ after :create do |goal|
10
+ create :medal, goal: goal
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :gamification_medal, aliases: [:medal], class: 'Gamification::Medal' do
5
+ goal nil
6
+ name Faker::Lorem.word
7
+ description Faker::Lorem.sentence
8
+ image 'http://example.org'
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :gamification_reward, aliases: [:reward], class: 'Gamification::Reward' do
5
+ goal nil
6
+ rewardable nil
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gamification::ApplicationHelper do
4
+ describe '.reward' do
5
+ let(:article) { create :article }
6
+ let(:user) { create :user }
7
+
8
+ it 'renders a form' do
9
+ form = Capybara.string reward user, for: article
10
+
11
+ expect(form).to have_button 'Complete goals'
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ module Gamification
4
+ describe RewardsHelper do
5
+ describe '#present_rewards' do
6
+ let!(:user) { create :user }
7
+ let!(:reward) { create :reward, seen_at: nil, rewardable: user }
8
+
9
+ it 'renders a partial' do
10
+ expect(helper).to receive(:render) do |options|
11
+ expect(options[:locals]).to eq rewards: [reward]
12
+ end
13
+
14
+ helper.present_rewards for: user
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gamification::Concerns::Rewardable do
4
+ describe '#medals' do
5
+ let(:user) { create :user }
6
+ let(:medal) { create :gamification_medal }
7
+ let(:goal) { create :gamification_goal, medal: medal }
8
+
9
+ before do
10
+ create :gamification_reward, rewardable: user, goal: goal
11
+ end
12
+
13
+ it 'returns medals' do
14
+ expect(user.medals).to eq [medal]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,65 @@
1
+ require 'spec_helper'
2
+
3
+ module Gamification
4
+ describe Goal do
5
+ let(:subject) { create :user }
6
+ let(:goal) { create :gamification_goal }
7
+
8
+ describe '#completed_by?' do
9
+ context 'for a goal that is completed by the given subject' do
10
+ before do
11
+ create :gamification_reward, goal: goal, rewardable: subject
12
+ end
13
+
14
+ it 'returns true' do
15
+ expect(goal).to be_completed_by subject
16
+ end
17
+ end
18
+
19
+ context 'for a goal that is not completed by the given subject' do
20
+ it 'returns false' do
21
+ expect(goal).not_to be_completed_by subject
22
+ end
23
+ end
24
+ end
25
+
26
+ describe '#complete_for' do
27
+ context 'for a goal that is not yet completed' do
28
+ it 'creates a reward for the given subject' do
29
+ expect(goal.complete_for subject).to be_instance_of Reward
30
+ end
31
+ end
32
+
33
+ context 'for a goal that is already completed' do
34
+ before do
35
+ create :gamification_reward, goal: goal, rewardable: subject
36
+ end
37
+
38
+ it 'raises an error' do
39
+ expect { goal.complete_for subject}.to raise_error Goal::Completed
40
+ end
41
+ end
42
+ end
43
+
44
+ describe '.completed_by' do
45
+ let!(:complete_goal) { create :gamification_goal }
46
+ let!(:incomplete_goal) { create :gamification_goal }
47
+
48
+ before do
49
+ complete_goal.complete_for subject
50
+ end
51
+
52
+ it 'returns completed goals by a given subject' do
53
+ expect(Goal.completed_by(subject).count).to eq 1
54
+ end
55
+ end
56
+
57
+ describe '.incomplete_by' do
58
+ let!(:incomplete_goals) { create_list :gamification_goal, 2 }
59
+
60
+ it 'returns incomplete goals by a given subject' do
61
+ expect(Goal.incomplete_by(subject).count).to eq 2
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ module Gamification
4
+ describe Medal do
5
+ end
6
+ end
@@ -0,0 +1,102 @@
1
+ require 'spec_helper'
2
+
3
+ module Gamification
4
+ describe Reward do
5
+ describe '.with_medals' do
6
+ let!(:goal_with_medal) { create :goal }
7
+ let!(:goal_without_medal) { create :goal }
8
+ let!(:medal) { create :medal, goal: goal_with_medal }
9
+
10
+ let!(:reward_with_medal) { create :reward, goal: goal_with_medal }
11
+ let!(:reward_without_medal) { create :reward, goal: goal_without_medal }
12
+
13
+ it 'should return rewards with medals' do
14
+ expect(described_class.with_medals).to eq [reward_with_medal]
15
+ end
16
+ end
17
+
18
+ describe '.without_medals' do
19
+ let!(:goal_with_medal) { create :goal }
20
+ let!(:goal_without_medal) { create :goal }
21
+ let!(:medal) { create :medal, goal: goal_with_medal }
22
+
23
+ let!(:reward_with_medal) { create :reward, goal: goal_with_medal }
24
+ let!(:reward_without_medal) { create :reward, goal: goal_without_medal }
25
+
26
+ it 'should return rewards without medals' do
27
+ expect(described_class.without_medals).to eq [reward_without_medal]
28
+ end
29
+ end
30
+
31
+ describe '.seen' do
32
+ let(:seen_reward) { create :reward, seen_at: 2.days.ago }
33
+ let(:unseen_reward) { create :reward, seen_at: nil }
34
+
35
+ it 'should return seen rewards' do
36
+ expect(described_class.seen).to eq [seen_reward]
37
+ end
38
+ end
39
+
40
+ describe '.unseen' do
41
+ let(:seen_reward) { create :reward, seen_at: 2.days.ago }
42
+ let(:unseen_reward) { create :reward, seen_at: nil }
43
+
44
+ it 'should return unseen rewards' do
45
+ expect(described_class.unseen).to eq [unseen_reward]
46
+ end
47
+ end
48
+
49
+ describe '#see' do
50
+ let(:reward) { create :reward, seen_at: nil }
51
+
52
+ before do
53
+ reward.see
54
+ end
55
+
56
+ around do
57
+ Timecop.freeze
58
+ end
59
+
60
+ it 'should set seen_at to the current time' do
61
+ expect(reward.seen_at.utc.to_s).to eq Time.now.utc.to_s
62
+ end
63
+ end
64
+
65
+ describe '.see' do
66
+ let(:rewards) { create_list :reward, 3, seen_at: nil }
67
+
68
+ before do
69
+ rewards.see
70
+ end
71
+
72
+ around do
73
+ Timecop.freeze
74
+ end
75
+
76
+ it 'should set seen_at to the current time' do
77
+ rewards.each do |reward|
78
+ expect(reward.seen_at.utc.to_s).to eq Time.now.utc.to_s
79
+ end
80
+ end
81
+ end
82
+
83
+ describe '#seen?' do
84
+
85
+ context 'with a reward that has not been seen' do
86
+ let(:reward) { create :reward, seen_at: nil }
87
+
88
+ it 'should not be seen' do
89
+ expect(reward).not_to be_seen
90
+ end
91
+ end
92
+
93
+ context 'with a reward that has been seen' do
94
+ let(:reward) { create :reward, seen_at: 2.days.ago }
95
+
96
+ it 'should be seen' do
97
+ expect(reward).to be_seen
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
data/spec/spec_helper.rb CHANGED
@@ -3,7 +3,9 @@ ENV['RAILS_ENV'] ||= 'test'
3
3
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
4
  require 'rspec/rails'
5
5
  require 'rspec/autorun'
6
+ require 'faker'
6
7
  require 'factory_girl_rails'
8
+ require 'timecop'
7
9
 
8
10
  Rails.backtrace_cleaner.remove_silencers!
9
11
 
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'gamification/rewards/_presentation.html.erb' do
4
+ let!(:goal) { create :goal, points: 100 }
5
+ let!(:reward) { create :reward, goal: goal }
6
+ let!(:medal) { create :medal, goal: goal }
7
+
8
+ before do
9
+ render partial: 'gamification/rewards/presentation', locals: { rewards: [reward] }
10
+ end
11
+
12
+ it 'should contain the name of the medal' do
13
+ expect(rendered).to include medal.name
14
+ end
15
+
16
+ it 'should contain the description of the medal' do
17
+ expect(rendered).to include medal.description
18
+ end
19
+
20
+ it 'should contain the how many points the goal is worth' do
21
+ expect(rendered).to include goal.points.to_s
22
+ end
23
+ end
metadata CHANGED
@@ -1,69 +1,167 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Gorset
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-09 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0.rc1
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.0.rc1
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: carrierwave
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.10'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: mini_magick
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.7'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.7'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: sqlite3
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
- - - '>='
59
+ - - ">="
32
60
  - !ruby/object:Gem::Version
33
61
  version: '0'
34
62
  type: :development
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
- - - '>='
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: guard-rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
39
81
  - !ruby/object:Gem::Version
40
82
  version: '0'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: rspec-rails
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
- - - '>='
87
+ - - ">="
46
88
  - !ruby/object:Gem::Version
47
89
  version: '0'
48
90
  type: :development
49
91
  prerelease: false
50
92
  version_requirements: !ruby/object:Gem::Requirement
51
93
  requirements:
52
- - - '>='
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: capybara
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
53
109
  - !ruby/object:Gem::Version
54
110
  version: '0'
55
111
  - !ruby/object:Gem::Dependency
56
112
  name: factory_girl_rails
57
113
  requirement: !ruby/object:Gem::Requirement
58
114
  requirements:
59
- - - '>='
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: timecop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: faker
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: thor
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
60
158
  - !ruby/object:Gem::Version
61
159
  version: '0'
62
160
  type: :development
63
161
  prerelease: false
64
162
  version_requirements: !ruby/object:Gem::Requirement
65
163
  requirements:
66
- - - '>='
164
+ - - ">="
67
165
  - !ruby/object:Gem::Version
68
166
  version: '0'
69
167
  description: Gamification is a collection of models for Ruby on Rails that allows
@@ -74,34 +172,57 @@ executables: []
74
172
  extensions: []
75
173
  extra_rdoc_files: []
76
174
  files:
77
- - MIT-LICENSE
78
175
  - Rakefile
79
176
  - app/assets/javascripts/gamification/application.js
80
177
  - app/assets/stylesheets/gamification/application.css
81
178
  - app/controllers/gamification/application_controller.rb
179
+ - app/controllers/gamification/rewards_controller.rb
82
180
  - app/helpers/gamification/application_helper.rb
83
- - app/models/gamification/scoring.rb
84
- - app/models/gamification/task.rb
85
- - app/views/layouts/gamification/application.html.erb
181
+ - app/helpers/gamification/rewards_helper.rb
182
+ - app/models/gamification/goal.rb
183
+ - app/models/gamification/medal.rb
184
+ - app/models/gamification/reward.rb
185
+ - app/uploaders/gamification/image_uploader.rb
186
+ - app/views/gamification/rewards/_presentation.html.erb
187
+ - app/views/gamification/rewards/_reward.html.erb
188
+ - app/views/gamification/scorings/create.html.erb
189
+ - config/initializers/routing.rb
190
+ - config/locales/en.yml
191
+ - config/locales/nb.yml
86
192
  - config/routes.rb
87
193
  - db/migrate/20140309173049_create_gamification_tasks.rb
88
194
  - db/migrate/20140309175957_create_gamification_scorings.rb
195
+ - db/migrate/20140310081749_rename_everything.rb
196
+ - db/migrate/20140313134259_create_gamification_medals.rb
197
+ - db/migrate/20140314132611_add_description_to_gamification_medals.rb
198
+ - db/migrate/20140315142524_rename_gamification_tasks_to_goals.rb
199
+ - db/migrate/20140318220723_add_seen_at_to_gamification_rewards.rb
89
200
  - lib/gamification.rb
201
+ - lib/gamification/activerecord.rb
90
202
  - lib/gamification/concerns.rb
91
203
  - lib/gamification/concerns/models.rb
92
- - lib/gamification/concerns/models/scoring.rb
93
- - lib/gamification/concerns/models/task.rb
204
+ - lib/gamification/concerns/models/goal.rb
205
+ - lib/gamification/concerns/models/medal.rb
206
+ - lib/gamification/concerns/models/reward.rb
207
+ - lib/gamification/concerns/rewardable.rb
208
+ - lib/gamification/concerns/rewarding.rb
94
209
  - lib/gamification/engine.rb
95
210
  - lib/gamification/version.rb
96
211
  - lib/tasks/gamification_tasks.rake
212
+ - spec/controllers/gamification/rewards_controller_spec.rb
97
213
  - spec/dummy/README.rdoc
98
214
  - spec/dummy/Rakefile
99
215
  - spec/dummy/app/assets/javascripts/application.js
216
+ - spec/dummy/app/assets/javascripts/articles.js
100
217
  - spec/dummy/app/assets/stylesheets/application.css
218
+ - spec/dummy/app/assets/stylesheets/articles.css
101
219
  - spec/dummy/app/controllers/application_controller.rb
220
+ - spec/dummy/app/controllers/articles_controller.rb
102
221
  - spec/dummy/app/helpers/application_helper.rb
222
+ - spec/dummy/app/helpers/articles_helper.rb
103
223
  - spec/dummy/app/models/article.rb
104
224
  - spec/dummy/app/models/user.rb
225
+ - spec/dummy/app/views/articles/show.html.erb
105
226
  - spec/dummy/app/views/layouts/application.html.erb
106
227
  - spec/dummy/bin/bundle
107
228
  - spec/dummy/bin/rails
@@ -135,15 +256,24 @@ files:
135
256
  - spec/dummy/public/422.html
136
257
  - spec/dummy/public/500.html
137
258
  - spec/dummy/public/favicon.ico
259
+ - spec/dummy/spec/controllers/articles_controller_spec.rb
138
260
  - spec/dummy/spec/factories/articles.rb
139
261
  - spec/dummy/spec/factories/users.rb
262
+ - spec/dummy/spec/helpers/articles_helper_spec.rb
140
263
  - spec/dummy/spec/models/article_spec.rb
141
264
  - spec/dummy/spec/models/user_spec.rb
142
- - spec/factories/gamification_scorings.rb
143
- - spec/factories/gamification_tasks.rb
144
- - spec/models/gamification/scoring_spec.rb
145
- - spec/models/gamification/task_spec.rb
265
+ - spec/dummy/spec/views/articles/show.html.erb_spec.rb
266
+ - spec/factories/gamification_goals.rb
267
+ - spec/factories/gamification_medals.rb
268
+ - spec/factories/gamification_rewards.rb
269
+ - spec/helpers/gamification/application_helper_spec.rb
270
+ - spec/helpers/gamification/rewards_helper_spec.rb
271
+ - spec/lib/gamification/concerns/rewardable_spec.rb
272
+ - spec/models/gamification/goal_spec.rb
273
+ - spec/models/gamification/medal_spec.rb
274
+ - spec/models/gamification/reward_spec.rb
146
275
  - spec/spec_helper.rb
276
+ - spec/views/gamification/rewards/_presentation.html.erb_spec.rb
147
277
  homepage: http://github.com/hyperoslo/gamification
148
278
  licenses:
149
279
  - MIT
@@ -154,12 +284,12 @@ require_paths:
154
284
  - lib
155
285
  required_ruby_version: !ruby/object:Gem::Requirement
156
286
  requirements:
157
- - - '>='
287
+ - - ">="
158
288
  - !ruby/object:Gem::Version
159
289
  version: '0'
160
290
  required_rubygems_version: !ruby/object:Gem::Requirement
161
291
  requirements:
162
- - - '>='
292
+ - - ">="
163
293
  - !ruby/object:Gem::Version
164
294
  version: '0'
165
295
  requirements: []
@@ -170,12 +300,18 @@ specification_version: 4
170
300
  summary: Gamification is a collection of models for Ruby on Rails that allows you
171
301
  to make anything a game
172
302
  test_files:
303
+ - spec/controllers/gamification/rewards_controller_spec.rb
173
304
  - spec/dummy/app/assets/javascripts/application.js
305
+ - spec/dummy/app/assets/javascripts/articles.js
174
306
  - spec/dummy/app/assets/stylesheets/application.css
307
+ - spec/dummy/app/assets/stylesheets/articles.css
175
308
  - spec/dummy/app/controllers/application_controller.rb
309
+ - spec/dummy/app/controllers/articles_controller.rb
176
310
  - spec/dummy/app/helpers/application_helper.rb
311
+ - spec/dummy/app/helpers/articles_helper.rb
177
312
  - spec/dummy/app/models/article.rb
178
313
  - spec/dummy/app/models/user.rb
314
+ - spec/dummy/app/views/articles/show.html.erb
179
315
  - spec/dummy/app/views/layouts/application.html.erb
180
316
  - spec/dummy/bin/bundle
181
317
  - spec/dummy/bin/rails
@@ -211,12 +347,21 @@ test_files:
211
347
  - spec/dummy/public/favicon.ico
212
348
  - spec/dummy/Rakefile
213
349
  - spec/dummy/README.rdoc
350
+ - spec/dummy/spec/controllers/articles_controller_spec.rb
214
351
  - spec/dummy/spec/factories/articles.rb
215
352
  - spec/dummy/spec/factories/users.rb
353
+ - spec/dummy/spec/helpers/articles_helper_spec.rb
216
354
  - spec/dummy/spec/models/article_spec.rb
217
355
  - spec/dummy/spec/models/user_spec.rb
218
- - spec/factories/gamification_scorings.rb
219
- - spec/factories/gamification_tasks.rb
220
- - spec/models/gamification/scoring_spec.rb
221
- - spec/models/gamification/task_spec.rb
356
+ - spec/dummy/spec/views/articles/show.html.erb_spec.rb
357
+ - spec/factories/gamification_goals.rb
358
+ - spec/factories/gamification_medals.rb
359
+ - spec/factories/gamification_rewards.rb
360
+ - spec/helpers/gamification/application_helper_spec.rb
361
+ - spec/helpers/gamification/rewards_helper_spec.rb
362
+ - spec/lib/gamification/concerns/rewardable_spec.rb
363
+ - spec/models/gamification/goal_spec.rb
364
+ - spec/models/gamification/medal_spec.rb
365
+ - spec/models/gamification/reward_spec.rb
222
366
  - spec/spec_helper.rb
367
+ - spec/views/gamification/rewards/_presentation.html.erb_spec.rb