qualtrics_api 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3989bd675ef7fdd3d656332a25415f2531ab8d0d
|
4
|
+
data.tar.gz: 6ac2c42f3b7243b0a5079eb693c085793b9d7bc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99b339083e65224cd22f62bf3aa23ee391e96443b2d8dbf94525e6f81159fd612974babf7f54fcdfa0af97b75604215069b56715e63f41588ecab7c578889979
|
7
|
+
data.tar.gz: d70be5772c5612bbab692aafc34a150a971a6dbfd6f25e50eb63fd2549a345649c6d70760a697cb76434aac58d9c4c6c7ad4692682bf94ef745e1f82852dce94
|
@@ -6,7 +6,7 @@ module QualtricsAPI
|
|
6
6
|
attribute :email, String
|
7
7
|
attribute :language, String
|
8
8
|
attribute :unsubscribed, Integer
|
9
|
-
attribute :
|
9
|
+
attribute :external_reference, String
|
10
10
|
attribute :embeded_data, Hash
|
11
11
|
|
12
12
|
def to_json(_options = {})
|
@@ -29,10 +29,10 @@ module QualtricsAPI
|
|
29
29
|
|
30
30
|
def attributes_mappings
|
31
31
|
{
|
32
|
-
:id => "
|
32
|
+
:id => "recipientID",
|
33
33
|
:first_name => "firstName",
|
34
34
|
:last_name => "lastName",
|
35
|
-
:
|
35
|
+
:external_reference => "externalReference",
|
36
36
|
:embeded_data => "embeddedData"
|
37
37
|
}
|
38
38
|
end
|
@@ -6,8 +6,8 @@ describe QualtricsAPI::PanelMemberCollection do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
describe "#find, #[]" do
|
9
|
-
let(:panel_member_1) { QualtricsAPI::PanelMember.new("
|
10
|
-
let(:panel_member_2) { QualtricsAPI::PanelMember.new("
|
9
|
+
let(:panel_member_1) { QualtricsAPI::PanelMember.new("recipientID" => "p1") }
|
10
|
+
let(:panel_member_2) { QualtricsAPI::PanelMember.new("recipientID" => "p2") }
|
11
11
|
|
12
12
|
it "finds the panel member by id" do
|
13
13
|
subject.instance_variable_set :@all, [panel_member_1, panel_member_2]
|
@@ -65,7 +65,7 @@ describe QualtricsAPI::PanelMemberCollection do
|
|
65
65
|
QualtricsAPI.panels.fetch['ML_bC2c5xBz1DxyOYB'].members.create(panel_members)
|
66
66
|
end
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
describe "when success" do
|
70
70
|
let(:cassette) { "panel_member_collection_create_success" }
|
71
71
|
let(:panel_members) { [QualtricsAPI::PanelMember.new(first_name: 'Marcin', last_name: 'Naglik', email: 'test@test.com')] }
|
@@ -73,7 +73,7 @@ describe QualtricsAPI::PanelMemberCollection do
|
|
73
73
|
it "returns PanelImport" do
|
74
74
|
expect(result).to be_a QualtricsAPI::PanelImport
|
75
75
|
end
|
76
|
-
|
76
|
+
|
77
77
|
it "returns PanelImport with id" do
|
78
78
|
expect(result.id).to eq('PGRS_bEJLYLkqMBs8Bwx')
|
79
79
|
end
|
@@ -88,7 +88,7 @@ describe QualtricsAPI::PanelMemberCollection do
|
|
88
88
|
let(:panel_members) { [QualtricsAPI::PanelMember.new] }
|
89
89
|
|
90
90
|
it "returns results" do
|
91
|
-
expect { result }.to raise_error
|
91
|
+
expect { result }.to raise_error
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
@@ -3,13 +3,13 @@ require 'spec_helper'
|
|
3
3
|
describe QualtricsAPI::PanelMember do
|
4
4
|
let(:panel_member) do
|
5
5
|
{
|
6
|
-
"
|
6
|
+
"recipientID" => "ML_abcdefg",
|
7
7
|
"firstName" => "Thom",
|
8
8
|
"lastName" => "Yorke",
|
9
9
|
"email" => "thom@radiohead.com",
|
10
10
|
"language" => "EN",
|
11
11
|
"unsubscribed" => 1,
|
12
|
-
"
|
12
|
+
"externalReference" => "1234",
|
13
13
|
"embeddedData" => { "a" => "b", "b" => "c" }
|
14
14
|
}
|
15
15
|
end
|
@@ -17,7 +17,7 @@ describe QualtricsAPI::PanelMember do
|
|
17
17
|
subject { described_class.new panel_member }
|
18
18
|
|
19
19
|
it "has a panel member id" do
|
20
|
-
expect(subject.id).to eq(panel_member["
|
20
|
+
expect(subject.id).to eq(panel_member["recipientID"])
|
21
21
|
end
|
22
22
|
|
23
23
|
it "has a first name" do
|
@@ -41,7 +41,7 @@ describe QualtricsAPI::PanelMember do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
it "has external data reference" do
|
44
|
-
expect(subject.
|
44
|
+
expect(subject.external_reference).to eq(panel_member["externalReference"])
|
45
45
|
end
|
46
46
|
|
47
47
|
it "has embedded data" do
|
@@ -52,13 +52,13 @@ describe QualtricsAPI::PanelMember do
|
|
52
52
|
let(:members) { [subject].to_json }
|
53
53
|
it "serialize array of panel members" do
|
54
54
|
expect(JSON.parse(members)).to eq(
|
55
|
-
[{ "
|
55
|
+
[{ "RecipientID" => "ML_abcdefg",
|
56
56
|
"FirstName" => "Thom",
|
57
57
|
"LastName" => "Yorke",
|
58
58
|
"Email" => "thom@radiohead.com",
|
59
59
|
"Language" => "EN",
|
60
60
|
"Unsubscribed" => 1,
|
61
|
-
"
|
61
|
+
"ExternalReference" => "1234",
|
62
62
|
"EmbeddedData" => { "a" => "b", "b" => "c" } }])
|
63
63
|
end
|
64
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qualtrics_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yurui Zhang
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-07-
|
13
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|