erp_agreements 3.0.4 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/agreement.rb +3 -2
- data/app/models/agreement_item.rb +2 -0
- data/app/models/agreement_item_type.rb +2 -0
- data/app/models/agreement_party_role.rb +2 -0
- data/app/models/agreement_relationship.rb +2 -0
- data/app/models/agreement_reln_type.rb +2 -0
- data/app/models/agreement_role_type.rb +2 -0
- data/app/models/agreement_type.rb +2 -0
- data/app/models/loyalty_program_code.rb +4 -2
- data/lib/erp_agreements.rb +3 -0
- data/lib/erp_agreements/version.rb +2 -2
- data/spec/dummy/config/application.rb +6 -0
- data/spec/dummy/config/environments/spec.rb +3 -0
- data/spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb +15 -0
- data/spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb +19 -0
- data/spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb +16 -0
- data/spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb +12 -0
- data/spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb +22 -0
- data/spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb +14 -0
- data/spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb +20 -0
- data/spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb +24 -0
- data/spec/dummy/db/migrate/20130107214618_base_erp_services.erp_base_erp_svcs.rb +461 -0
- data/spec/dummy/db/migrate/20130107214619_agreements_services.erp_agreements.rb +160 -0
- data/spec/dummy/db/migrate/20130107214620_agreements_services_indexes.erp_agreements.rb +52 -0
- data/spec/dummy/db/migrate/20130107214621_base_tech_services.erp_tech_svcs.rb +271 -0
- data/spec/dummy/db/migrate/20130107214622_create_has_attribute_tables.erp_tech_svcs.rb +39 -0
- data/spec/dummy/db/migrate/20130107214623_create_groups.erp_tech_svcs.rb +19 -0
- data/spec/dummy/db/migrate/20130107214624_upgrade_security.erp_tech_svcs.rb +54 -0
- data/spec/dummy/db/migrate/20130107214625_upgrade_security2.erp_tech_svcs.rb +270 -0
- data/spec/dummy/db/schema.rb +747 -0
- data/spec/dummy/db/spec.sqlite3 +0 -0
- data/spec/dummy/log/development.log +2 -0
- data/spec/dummy/log/spec.log +13137 -0
- data/spec/factories/agreement.rb +2 -0
- data/spec/models/agreement_relationship_spec.rb +1 -1
- data/spec/models/agreement_spec.rb +15 -15
- data/spec/spec_helper.rb +10 -3
- metadata +67 -9
data/spec/factories/agreement.rb
CHANGED
@@ -16,7 +16,7 @@ describe AgreementRelationship do
|
|
16
16
|
@seller_role_type = AgreementRoleType.create(:description => 'seller', :internal_identifier => 'seller')
|
17
17
|
@buyer_role_type = AgreementRoleType.create(:description => 'buyer', :internal_identifier => 'buyer')
|
18
18
|
|
19
|
-
@agreement_reln_type =
|
19
|
+
@agreement_reln_type = FactoryGirl.create(:agreement_reln_type,
|
20
20
|
:description => 'Buyer Seller',
|
21
21
|
:internal_identifier => 'buyer_seller',
|
22
22
|
:valid_from_role => @seller_role_type,
|
@@ -2,30 +2,30 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Agreement do
|
4
4
|
it "can be instantiated" do
|
5
|
-
agreement =
|
5
|
+
agreement = FactoryGirl.build(:agreement, :description => 'My Agreement')
|
6
6
|
agreement.should be_an_instance_of(Agreement)
|
7
7
|
end
|
8
8
|
|
9
9
|
it "can be saved successfully" do
|
10
|
-
agreement =
|
10
|
+
agreement = FactoryGirl.build(:agreement, :description => 'My Agreement')
|
11
11
|
agreement.save.should eq true
|
12
12
|
end
|
13
13
|
|
14
14
|
it "can use agreement items as methods" do
|
15
|
-
agreement_item_type =
|
16
|
-
agreement_item =
|
17
|
-
agreement =
|
15
|
+
agreement_item_type = FactoryGirl.build(:agreement_item_type, :internal_identifier => 'reference_number')
|
16
|
+
agreement_item = FactoryGirl.build(:agreement_item, :agreement_item_type => agreement_item_type, :agreement_item_value => '1234ABCD')
|
17
|
+
agreement = FactoryGirl.build(:agreement, :description => 'My Agreement')
|
18
18
|
agreement.items << agreement_item
|
19
19
|
agreement.save!
|
20
20
|
agreement.reference_number.should == '1234ABCD'
|
21
21
|
end
|
22
22
|
|
23
23
|
it "can have agreement relationships" do
|
24
|
-
agreement_reln_type =
|
25
|
-
agreement_reln =
|
24
|
+
agreement_reln_type = FactoryGirl.build(:agreement_reln_type, :internal_identifier => 'test_reln_type', :description => 'test reln type')
|
25
|
+
agreement_reln = FactoryGirl.build(:agreement_relationship, :description => 'test reln',
|
26
26
|
:relationship_type => agreement_reln_type)
|
27
|
-
agreement_one =
|
28
|
-
agreement_two =
|
27
|
+
agreement_one = FactoryGirl.build(:agreement, :description => 'Agreement One')
|
28
|
+
agreement_two = FactoryGirl.build(:agreement, :description => 'Agreement two')
|
29
29
|
|
30
30
|
agreement_reln.agreement_from = agreement_one
|
31
31
|
agreement_reln.agreement_to = agreement_two
|
@@ -36,22 +36,22 @@ describe Agreement do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "has a method to_s that returns description" do
|
39
|
-
agreement =
|
39
|
+
agreement = FactoryGirl.create(:agreement, :description => 'My Agreement')
|
40
40
|
agreement.to_s.should eq 'My Agreement'
|
41
41
|
end
|
42
42
|
|
43
43
|
it "has a method to_label that calls to_s which returns description" do
|
44
|
-
agreement =
|
44
|
+
agreement = FactoryGirl.create(:agreement, :description => 'My Agreement')
|
45
45
|
agreement.to_label.should eq 'My Agreement'
|
46
46
|
end
|
47
47
|
|
48
48
|
it "can find paties by roles" do
|
49
49
|
#TODO this needs to factored to use erp_base_base_erp_svcs factories
|
50
|
-
party =
|
51
|
-
role_type =
|
50
|
+
party = FactoryGirl.create(:party, :description => 'Joe Smith')
|
51
|
+
role_type = FactoryGirl.create(:role_type, :description => 'owner', :internal_identifier => 'owner')
|
52
52
|
|
53
|
-
agreement =
|
54
|
-
agreement_party_role =
|
53
|
+
agreement = FactoryGirl.create(:agreement, :description => 'My Agreement')
|
54
|
+
agreement_party_role = FactoryGirl.create(:agreement_party_role,
|
55
55
|
:description => 'My Agreement',
|
56
56
|
:role_type => role_type,
|
57
57
|
:party => party,
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'spork'
|
2
2
|
require 'rake'
|
3
|
+
require 'factory_girl'
|
3
4
|
|
4
5
|
Spork.prefork do
|
5
6
|
# Loading more in this block will cause your tests to run faster. However,
|
@@ -31,6 +32,7 @@ Spork.prefork do
|
|
31
32
|
|
32
33
|
RSpec.configure do |config|
|
33
34
|
config.use_transactional_fixtures = true
|
35
|
+
config.include FactoryGirl::Syntax::Methods
|
34
36
|
config.include Sorcery::TestHelpers::Rails
|
35
37
|
config.include ErpDevSvcs
|
36
38
|
config.include ErpDevSvcs::ControllerSupport, :type => :controller
|
@@ -40,12 +42,17 @@ end
|
|
40
42
|
Spork.each_run do
|
41
43
|
#We have to execute the migrations from dummy app directory
|
42
44
|
Dir.chdir DUMMY_APP_ROOT
|
43
|
-
`rake db:drop`
|
45
|
+
`rake db:drop RAILS_ENV=spec`
|
44
46
|
Dir.chdir ENGINE_RAILS_ROOT
|
45
47
|
|
46
|
-
#We have to execute the
|
48
|
+
#We have to execute the migratiapp:compass_ae:install:data_migrationsons from dummy app directory
|
47
49
|
Dir.chdir DUMMY_APP_ROOT
|
48
|
-
|
50
|
+
|
51
|
+
|
52
|
+
`rake compass_ae:install:migrations RAILS_ENV=spec`
|
53
|
+
`rake compass_ae:install:data_migrations RAILS_ENV=spec`
|
54
|
+
`rake db:migrate RAILS_ENV=spec`
|
55
|
+
`rake db:migrate_data RAILS_ENV=spec`
|
49
56
|
Dir.chdir ENGINE_RAILS_ROOT
|
50
57
|
|
51
58
|
ErpDevSvcs::FactorySupport.load_engine_factories
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erp_agreements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,30 +9,40 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erp_tech_svcs
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '3.
|
21
|
+
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: erp_dev_svcs
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
31
36
|
- !ruby/object:Gem::Version
|
32
|
-
version: '3.
|
37
|
+
version: '3.1'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.1'
|
36
46
|
description: The Agreements Engine implements model classes for storing Contracts
|
37
47
|
and Agreements data, including AgreementItems, which represent the terms of the
|
38
48
|
Agreement. Contracts are a special case of Agreements, specifically Agreements which
|
@@ -89,6 +99,27 @@ files:
|
|
89
99
|
- spec/dummy/config/locales/en.yml
|
90
100
|
- spec/dummy/config/routes.rb
|
91
101
|
- spec/dummy/config.ru
|
102
|
+
- spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb
|
103
|
+
- spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb
|
104
|
+
- spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb
|
105
|
+
- spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb
|
106
|
+
- spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb
|
107
|
+
- spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb
|
108
|
+
- spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb
|
109
|
+
- spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb
|
110
|
+
- spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb
|
111
|
+
- spec/dummy/db/migrate/20130107214618_base_erp_services.erp_base_erp_svcs.rb
|
112
|
+
- spec/dummy/db/migrate/20130107214619_agreements_services.erp_agreements.rb
|
113
|
+
- spec/dummy/db/migrate/20130107214620_agreements_services_indexes.erp_agreements.rb
|
114
|
+
- spec/dummy/db/migrate/20130107214621_base_tech_services.erp_tech_svcs.rb
|
115
|
+
- spec/dummy/db/migrate/20130107214622_create_has_attribute_tables.erp_tech_svcs.rb
|
116
|
+
- spec/dummy/db/migrate/20130107214623_create_groups.erp_tech_svcs.rb
|
117
|
+
- spec/dummy/db/migrate/20130107214624_upgrade_security.erp_tech_svcs.rb
|
118
|
+
- spec/dummy/db/migrate/20130107214625_upgrade_security2.erp_tech_svcs.rb
|
119
|
+
- spec/dummy/db/schema.rb
|
120
|
+
- spec/dummy/db/spec.sqlite3
|
121
|
+
- spec/dummy/log/development.log
|
122
|
+
- spec/dummy/log/spec.log
|
92
123
|
- spec/dummy/public/404.html
|
93
124
|
- spec/dummy/public/422.html
|
94
125
|
- spec/dummy/public/500.html
|
@@ -123,15 +154,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
154
|
- - ! '>='
|
124
155
|
- !ruby/object:Gem::Version
|
125
156
|
version: '0'
|
157
|
+
segments:
|
158
|
+
- 0
|
159
|
+
hash: 1965680495303618230
|
126
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
161
|
none: false
|
128
162
|
requirements:
|
129
163
|
- - ! '>='
|
130
164
|
- !ruby/object:Gem::Version
|
131
165
|
version: '0'
|
166
|
+
segments:
|
167
|
+
- 0
|
168
|
+
hash: 1965680495303618230
|
132
169
|
requirements: []
|
133
170
|
rubyforge_project:
|
134
|
-
rubygems_version: 1.8.
|
171
|
+
rubygems_version: 1.8.24
|
135
172
|
signing_key:
|
136
173
|
specification_version: 3
|
137
174
|
summary: The Agreements Engine implements model classes for storing Contracts and
|
@@ -156,6 +193,27 @@ test_files:
|
|
156
193
|
- spec/dummy/config/locales/en.yml
|
157
194
|
- spec/dummy/config/routes.rb
|
158
195
|
- spec/dummy/config.ru
|
196
|
+
- spec/dummy/db/data_migrations/20110109173616_create_capability_scope_types.erp_tech_svcs.rb
|
197
|
+
- spec/dummy/db/data_migrations/20110525001935_add_usd_currency.erp_base_erp_svcs.rb
|
198
|
+
- spec/dummy/db/data_migrations/20110609150135_add_iso_codes.erp_base_erp_svcs.rb
|
199
|
+
- spec/dummy/db/data_migrations/20110802200222_schedule_delete_expired_sessions_job.erp_tech_svcs.rb
|
200
|
+
- spec/dummy/db/data_migrations/20110913145838_setup_compass_ae_instance.erp_base_erp_svcs.rb
|
201
|
+
- spec/dummy/db/data_migrations/20111111144706_setup_audit_log_types.erp_tech_svcs.rb
|
202
|
+
- spec/dummy/db/data_migrations/20120109173616_create_download_capability_type.erp_tech_svcs.rb
|
203
|
+
- spec/dummy/db/data_migrations/20121116155018_create_group_relationship_and_role_types.erp_tech_svcs.rb
|
204
|
+
- spec/dummy/db/data_migrations/20121130212146_note_capabilities.erp_tech_svcs.rb
|
205
|
+
- spec/dummy/db/migrate/20130107214618_base_erp_services.erp_base_erp_svcs.rb
|
206
|
+
- spec/dummy/db/migrate/20130107214619_agreements_services.erp_agreements.rb
|
207
|
+
- spec/dummy/db/migrate/20130107214620_agreements_services_indexes.erp_agreements.rb
|
208
|
+
- spec/dummy/db/migrate/20130107214621_base_tech_services.erp_tech_svcs.rb
|
209
|
+
- spec/dummy/db/migrate/20130107214622_create_has_attribute_tables.erp_tech_svcs.rb
|
210
|
+
- spec/dummy/db/migrate/20130107214623_create_groups.erp_tech_svcs.rb
|
211
|
+
- spec/dummy/db/migrate/20130107214624_upgrade_security.erp_tech_svcs.rb
|
212
|
+
- spec/dummy/db/migrate/20130107214625_upgrade_security2.erp_tech_svcs.rb
|
213
|
+
- spec/dummy/db/schema.rb
|
214
|
+
- spec/dummy/db/spec.sqlite3
|
215
|
+
- spec/dummy/log/development.log
|
216
|
+
- spec/dummy/log/spec.log
|
159
217
|
- spec/dummy/public/404.html
|
160
218
|
- spec/dummy/public/422.html
|
161
219
|
- spec/dummy/public/500.html
|