Merge pull request #794 from differentreality/user_model_tests

Add tests for Event. Remove redundant function 'def week' from Event.
This commit is contained in:
Christian Bruckmayer 2016-03-05 13:45:39 +01:00
commit c5c392d4c7
3 changed files with 213 additions and 9 deletions

View file

@ -141,10 +141,6 @@ class Event < ActiveRecord::Base
abstract.to_s.split.size
end
def week
created_at.strftime('%W').to_i
end
def self.get_state_color(state)
color = {
new: '#0000FF', # blue
@ -214,7 +210,7 @@ class Event < ActiveRecord::Base
def abstract_limit
# If we don't have an event type, there is no need to count anything
return unless event_type
return unless event_type && abstract
len = abstract.split.size
max_words = event_type.maximum_abstract_length
min_words = event_type.minimum_abstract_length