limesurvey_rails 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -4
- data/app/models/limesurvey_rails/survey.rb +1 -1
- data/app/models/limesurvey_rails/survey_participation.rb +5 -1
- data/lib/limesurvey_rails/participant.rb +1 -1
- data/lib/limesurvey_rails/version.rb +1 -1
- data/limesurvey_rails.gemspec +9 -10
- data/spec/dummy/app/models/test_model.rb +4 -0
- data/spec/models/limesurvey_rails/participant_spec.rb +4 -6
- data/spec/models/limesurvey_rails/survey_participations_spec.rb +7 -0
- data/spec/support/utils.rb +1 -0
- metadata +24 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 040a8a1d11eb8bd08d37ea35775496c6c7535775
|
4
|
+
data.tar.gz: 567407cdfd672876fe9262739a5790d11289f2a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cf4a5effb4d7bc04240eeab51a63e8ea5034bdfc70db81aced37d136fab298332c578e2e302f5c6165f402f7c28e1d67943b7f6efefef17d0211a860246d31a
|
7
|
+
data.tar.gz: 12afd08be8c0ffc49a12b83952a32f09cc722866d4d28d15d1d7c560695e0cbaa15fee908742616d2c28d0c6871e7925915113980272f4d29a66679ea9867cc2
|
data/README.md
CHANGED
@@ -32,10 +32,7 @@ but there are many options ..
|
|
32
32
|
|
33
33
|
Because of [this](http://stackoverflow.com/posts/27786703) it's better run test separately (in a real scenario the *participant model* is expected to be initialized only once):
|
34
34
|
|
35
|
-
rake spec[main]
|
36
|
-
rake spec[survey]
|
37
|
-
rake spec[participant]
|
38
|
-
rake spec[participation]
|
35
|
+
rake spec[main] && rake spec[survey] && rake spec[participant] && rake spec[participation]
|
39
36
|
|
40
37
|
Reminder for further bug investigation:
|
41
38
|
|
@@ -134,7 +134,7 @@ module LimesurveyRails
|
|
134
134
|
private
|
135
135
|
|
136
136
|
def self.build(survey_id, lang = nil)
|
137
|
-
all_attributes = {id: survey_id}
|
137
|
+
all_attributes = {id: survey_id.to_i}
|
138
138
|
all_attributes.merge!(LimesurveyRails.get_survey_properties(survey_id,GET_SURVEY_PROPERTY_ATTRIBUTES))
|
139
139
|
|
140
140
|
# if all_attributes['active'] == 'Y'
|
data/limesurvey_rails.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["masciugo"]
|
10
10
|
spec.email = ["masciugo@gmail.com"]
|
11
11
|
spec.summary = %q{An ORM-like layer to Limesurvey}
|
12
|
-
spec.description = %q{
|
13
|
-
spec.homepage = ""
|
12
|
+
spec.description = %q{A limesurvey plugin for Rails to make an ActiveRecord model able to participate to Limesurvey surveys}
|
13
|
+
spec.homepage = "https://github.com/masciugo/limesurvey_rails"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -18,13 +18,12 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency
|
22
|
-
spec.add_runtime_dependency
|
21
|
+
spec.add_runtime_dependency 'rails', '~> 3.2', '>= 3.2.16'
|
22
|
+
spec.add_runtime_dependency 'limesurvey', '~> 1.0'
|
23
23
|
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency('gem-release')
|
24
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.0'
|
25
|
+
spec.add_development_dependency 'rspec-its', '~> 1.0'
|
26
|
+
spec.add_development_dependency 'factory_girl_rails', '~> 4'
|
27
|
+
spec.add_development_dependency 'sqlite3', '~> 1.3'
|
28
|
+
spec.add_development_dependency 'byebug', '~> 3.5'
|
30
29
|
end
|
@@ -21,7 +21,7 @@ module LimesurveyRails
|
|
21
21
|
its(:is_a_limesurvey_participant_class?) { is_expected.to be false }
|
22
22
|
end
|
23
23
|
|
24
|
-
describe ".is_a_limesurvey_participant"
|
24
|
+
describe ".is_a_limesurvey_participant" do
|
25
25
|
context "with no options" do
|
26
26
|
before(:all) do
|
27
27
|
reset_models
|
@@ -115,11 +115,9 @@ module LimesurveyRails
|
|
115
115
|
expect(a_participant.surveys).to be_empty
|
116
116
|
end
|
117
117
|
context "when has added to a survey" do
|
118
|
-
before(:each) { SurveyParticipation.create(:survey_id => test_survey.id, :participant_id => a_participant.id ) }
|
119
|
-
it "returns an array with one element" do
|
120
|
-
expect(a_participant.surveys.size).to eq 1
|
121
|
-
end
|
122
|
-
it "and that element containing a Survey object" do
|
118
|
+
before(:each) { SurveyParticipation.create!(:survey_id => test_survey.id, :participant_id => a_participant.id ) }
|
119
|
+
it "returns an array with one element and that element containing a Survey object" do
|
120
|
+
expect(a_participant.surveys.size).to eq 1 and
|
123
121
|
expect(a_participant.surveys.first).to be_kind_of(Survey)
|
124
122
|
end
|
125
123
|
context "when has added to another survey" do
|
@@ -108,6 +108,13 @@ module LimesurveyRails
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
describe "#to_s" do
|
112
|
+
let(:a_participation) { SurveyParticipation.create(:survey_id => test_survey.id, :participant_id => a_participant.id ) }
|
113
|
+
it "returns a short description" do
|
114
|
+
expect(a_participation.to_s).to eq "#{a_participant} (#{test_survey})"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
111
118
|
end
|
112
119
|
end
|
113
120
|
|
data/spec/support/utils.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: limesurvey_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- masciugo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-20 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
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 3.2.16
|
20
23
|
type: :runtime
|
@@ -22,6 +25,9 @@ dependencies:
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.2'
|
30
|
+
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 3.2.16
|
27
33
|
- !ruby/object:Gem::Dependency
|
@@ -70,59 +76,46 @@ dependencies:
|
|
70
76
|
name: factory_girl_rails
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
|
-
- - "
|
79
|
+
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
81
|
+
version: '4'
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
|
-
- - "
|
86
|
+
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
88
|
+
version: '4'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: sqlite3
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
86
92
|
requirements:
|
87
|
-
- - "
|
93
|
+
- - "~>"
|
88
94
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
95
|
+
version: '1.3'
|
90
96
|
type: :development
|
91
97
|
prerelease: false
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
93
99
|
requirements:
|
94
|
-
- - "
|
100
|
+
- - "~>"
|
95
101
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
102
|
+
version: '1.3'
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: byebug
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
100
106
|
requirements:
|
101
|
-
- - "
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '3.0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '3.0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: gem-release
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
107
|
+
- - "~>"
|
116
108
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
109
|
+
version: '3.5'
|
118
110
|
type: :development
|
119
111
|
prerelease: false
|
120
112
|
version_requirements: !ruby/object:Gem::Requirement
|
121
113
|
requirements:
|
122
|
-
- - "
|
114
|
+
- - "~>"
|
123
115
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
125
|
-
description:
|
116
|
+
version: '3.5'
|
117
|
+
description: A limesurvey plugin for Rails to make an ActiveRecord model able to participate
|
118
|
+
to Limesurvey surveys
|
126
119
|
email:
|
127
120
|
- masciugo@gmail.com
|
128
121
|
executables: []
|
@@ -212,7 +205,7 @@ files:
|
|
212
205
|
- spec/support/shared_examples.rb
|
213
206
|
- spec/support/test_limesurvey_constants.rb
|
214
207
|
- spec/support/utils.rb
|
215
|
-
homepage:
|
208
|
+
homepage: https://github.com/masciugo/limesurvey_rails
|
216
209
|
licenses:
|
217
210
|
- MIT
|
218
211
|
metadata: {}
|
@@ -232,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
225
|
version: '0'
|
233
226
|
requirements: []
|
234
227
|
rubyforge_project:
|
235
|
-
rubygems_version: 2.
|
228
|
+
rubygems_version: 2.4.5
|
236
229
|
signing_key:
|
237
230
|
specification_version: 4
|
238
231
|
summary: An ORM-like layer to Limesurvey
|