redmine_crm 0.0.36 → 0.0.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +160 -33
- data/Rakefile +3 -12
- data/bitbucket-pipelines.yml +20 -6
- data/doc/CHANGELOG +5 -0
- data/lib/redmine_crm.rb +5 -0
- data/lib/redmine_crm/acts_as_draftable/draft.rb +40 -0
- data/lib/redmine_crm/acts_as_draftable/rcrm_acts_as_draftable.rb +154 -0
- data/lib/redmine_crm/acts_as_taggable/rcrm_acts_as_taggable.rb +1 -1
- data/lib/redmine_crm/acts_as_viewed/rcrm_acts_as_viewed.rb +0 -1
- data/lib/redmine_crm/acts_as_votable/votable.rb +6 -10
- data/lib/redmine_crm/helpers/form_tag_helper.rb +31 -0
- data/lib/redmine_crm/money_helper.rb +0 -2
- data/lib/redmine_crm/version.rb +1 -1
- data/redmine_crm.gemspec +6 -1
- data/test/acts_as_draftable/draft_test.rb +29 -0
- data/test/acts_as_draftable/rcrm_acts_as_draftable_test.rb +185 -0
- data/test/acts_as_taggable/rcrm_acts_as_taggable_test.rb +9 -11
- data/test/acts_as_taggable/tag_list_test.rb +25 -29
- data/test/acts_as_taggable/tag_test.rb +58 -51
- data/test/acts_as_votable/rcrm_acts_as_votable_test.rb +6 -4
- data/test/acts_as_votable/rcrm_acts_as_voter_test.rb +7 -5
- data/test/acts_as_votable/votable_test.rb +1 -1
- data/test/database.yml +14 -18
- data/test/models/issue.rb +14 -0
- data/test/{fixtures → models}/news.rb +0 -0
- data/test/{fixtures → models}/project.rb +0 -0
- data/test/{fixtures → models}/user.rb +0 -0
- data/test/{fixtures → models}/vote_classes.rb +0 -20
- data/test/schema.rb +9 -1
- data/test/test_helper.rb +5 -57
- data/vendor/assets/javascripts/select2_helpers.js +39 -0
- metadata +75 -14
- data/test/fixtures/issue.rb +0 -22
- data/test/liquid/drops/liquid_test.rb +0 -52
data/test/fixtures/issue.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
class Issue < ActiveRecord::Base
|
2
|
-
rcrm_acts_as_taggable
|
3
|
-
rcrm_acts_as_viewed
|
4
|
-
|
5
|
-
belongs_to :project
|
6
|
-
belongs_to :user
|
7
|
-
belongs_to :author, :class_name => 'User'
|
8
|
-
validates_presence_of :description
|
9
|
-
|
10
|
-
scope :visible, lambda { where('1=1') }
|
11
|
-
|
12
|
-
def save_without_validation
|
13
|
-
save
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.quote_value(value)
|
17
|
-
connection.quote(value)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
class SpecialIssue < Issue
|
22
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# require File.dirname(__FILE__) + '/../liquid_helper'
|
2
|
-
|
3
|
-
# module RedmineCrm
|
4
|
-
# class LiquidTest < ActiveSupport::TestCase
|
5
|
-
|
6
|
-
# def test_user_drop
|
7
|
-
# user = User.first
|
8
|
-
# assert_match user.name, render("{{ user.name }}")
|
9
|
-
# end
|
10
|
-
|
11
|
-
# def test_users_drop
|
12
|
-
# users_name = User.all.map(&:name)
|
13
|
-
# rendered_text = render("{% for user in users %} {{user.name }} {% endfor %}")
|
14
|
-
# users_name.each do |name|
|
15
|
-
# assert_match name, rendered_text
|
16
|
-
# end
|
17
|
-
# end
|
18
|
-
|
19
|
-
# def test_issue_drop
|
20
|
-
# assert_match Issue.first.description, render("{{ issue.description }}")
|
21
|
-
# end
|
22
|
-
|
23
|
-
# def test_default_filter
|
24
|
-
# user = User.first
|
25
|
-
# user.name = nil
|
26
|
-
# user.save
|
27
|
-
# assert_match 'user', render("{{ user.name | default: 'user' }}")
|
28
|
-
# end
|
29
|
-
|
30
|
-
# private
|
31
|
-
|
32
|
-
# def render(content)
|
33
|
-
# assigns = {}
|
34
|
-
# assigns['now'] = Time.now
|
35
|
-
# assigns['today'] = Date.today.strftime(date_format)
|
36
|
-
# assigns['user'] = Liquid::UserDrop.new(User.first)
|
37
|
-
# assigns['users'] = Liquid::UsersDrop.new(User.all)
|
38
|
-
# assigns['issue'] = Liquid::IssueDrop.new(Issue.first)
|
39
|
-
|
40
|
-
# registers = {}
|
41
|
-
# begin
|
42
|
-
# ::Liquid::Template.parse(content).render(::Liquid::Context.new({}, assigns, registers)).html_safe
|
43
|
-
# rescue => e
|
44
|
-
# e.message
|
45
|
-
# end
|
46
|
-
# end
|
47
|
-
|
48
|
-
# def date_format
|
49
|
-
# '%d.%m.%Y'
|
50
|
-
# end
|
51
|
-
# end
|
52
|
-
# end
|