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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 351602763701027dc6e423683355a693202c5e9b
4
- data.tar.gz: 5f1e7ed4ac34354d4e40d0aed5a64c731b13b1f8
3
+ metadata.gz: 040a8a1d11eb8bd08d37ea35775496c6c7535775
4
+ data.tar.gz: 567407cdfd672876fe9262739a5790d11289f2a8
5
5
  SHA512:
6
- metadata.gz: 662be940c3c502bd8b0182faa73f030c0a5f64900603760c16bb76f896c54bbbf5936c852171f4b011176c47721afbcd52aa5afc76eb69ba007f15101c97ed33
7
- data.tar.gz: 7f8a2623bb2f34e3629c71d6c1e394f1f6f924fbf36dec0f3eb4cf31af06f8a4e4ef8985935a6bd3cf4ac455a27f06adbb8687b83d7124563e086a2e1db5baef
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'
@@ -37,7 +37,11 @@ module LimesurveyRails
37
37
  end
38
38
  end
39
39
  end
40
-
40
+
41
+ def to_s
42
+ "#{participant} (#{survey})"
43
+ end
44
+
41
45
  private
42
46
 
43
47
  def assign_ls_token_attributes
@@ -30,7 +30,7 @@ module LimesurveyRails
30
30
  end
31
31
 
32
32
  def available_surveys
33
- ids = surveys.map(&:id).map(&:to_s)
33
+ ids = surveys.map(&:id)
34
34
  Survey.all.delete_if{|s| ids.include? s.id }
35
35
  end
36
36
 
@@ -1,3 +1,3 @@
1
1
  module LimesurveyRails
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -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{An ORM-like layer to Limesurvey}
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(%q<rails>, ["~> 3.2.16"])
22
- spec.add_runtime_dependency(%q<limesurvey>, ["~> 1.0"])
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(%q<rspec-rails>, ["~> 3.0"])
25
- spec.add_development_dependency(%q<rspec-its>, ["~> 1.0"])
26
- spec.add_development_dependency(%q<factory_girl_rails>, [">= 0"])
27
- spec.add_development_dependency(%q<sqlite3>, [">= 0"])
28
- spec.add_development_dependency(%q<byebug>, [">= 3.0"])
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
@@ -4,4 +4,8 @@ class TestModel < ActiveRecord::Base
4
4
  def full_name
5
5
  "#{name} #{surname}"
6
6
  end
7
+
8
+ def to_s
9
+ full_name
10
+ end
7
11
  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", :wip do
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
 
@@ -10,6 +10,7 @@ end
10
10
 
11
11
  def get_brand_new_test_survey_id(opts = {})
12
12
  id = LimesurveyRails.add_survey(nil,'LIMESURVEY_RAILS TEST','en')
13
+ # puts "created survey #{id}"
13
14
  LimesurveyRails.activate_tokens(id,['1']) if opts[:activate_tokens]
14
15
  id
15
16
  end
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.2.0
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-06 00:00:00.000000000 Z
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
125
- description: An ORM-like layer to Limesurvey
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.2.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