Commit 1c96bcfcc2c78a26b94ae2b1570da04b1312462c
1 parent
6074f631
Exists in
colab
and in
4 other branches
Removing useless methods from user model.
Showing
2 changed files
with
0 additions
and
38 deletions
Show diff stats
app/models/user.rb
| ... | ... | @@ -16,12 +16,4 @@ class User < ActiveRecord::Base |
| 16 | 16 | def projects |
| 17 | 17 | project_ownerships.map { |project_ownership| project_ownership.project } |
| 18 | 18 | end |
| 19 | - | |
| 20 | - def reading_groups | |
| 21 | - reading_group_ownerships.map { |reading_group_ownership| reading_group_ownership.reading_group } | |
| 22 | - end | |
| 23 | - | |
| 24 | - def mezuro_configurations | |
| 25 | - mezuro_configuration_ownerships.map { |mezuro_configuration_ownership| mezuro_configuration_ownership.mezuro_configuration } | |
| 26 | - end | |
| 27 | 19 | end | ... | ... |
spec/models/user_spec.rb
| ... | ... | @@ -30,35 +30,5 @@ describe User, :type => :model do |
| 30 | 30 | expect(subject.projects).to eq([project]) |
| 31 | 31 | end |
| 32 | 32 | end |
| 33 | - | |
| 34 | - describe 'reading_groups' do | |
| 35 | - subject { FactoryGirl.build(:user) } | |
| 36 | - let(:reading_group) {FactoryGirl.build(:reading_group)} | |
| 37 | - let(:reading_group_ownership) {FactoryGirl.build(:reading_group_ownership)} | |
| 38 | - | |
| 39 | - before :each do | |
| 40 | - reading_group_ownership.expects(:reading_group).returns(reading_group) | |
| 41 | - subject.expects(:reading_group_ownerships).returns([reading_group_ownership]) | |
| 42 | - end | |
| 43 | - | |
| 44 | - it 'should return a list of reading groups owned by the user' do | |
| 45 | - expect(subject.reading_groups).to eq([reading_group]) | |
| 46 | - end | |
| 47 | - end | |
| 48 | - | |
| 49 | - describe 'mezuro_configurations' do | |
| 50 | - subject { FactoryGirl.build(:user) } | |
| 51 | - let(:mezuro_configuration) { FactoryGirl.build(:mezuro_configuration) } | |
| 52 | - let(:mezuro_configuration_ownership) { FactoryGirl.build(:mezuro_configuration_ownership) } | |
| 53 | - | |
| 54 | - before :each do | |
| 55 | - mezuro_configuration_ownership.expects(:mezuro_configuration).returns(mezuro_configuration) | |
| 56 | - subject.expects(:mezuro_configuration_ownerships).returns([mezuro_configuration_ownership]) | |
| 57 | - end | |
| 58 | - | |
| 59 | - it 'should return a list of mezuro configurations owned by the user' do | |
| 60 | - expect(subject.mezuro_configurations).to eq([mezuro_configuration]) | |
| 61 | - end | |
| 62 | - end | |
| 63 | 33 | end |
| 64 | 34 | end | ... | ... |