lessonly-ruby 0.0.1 → 0.1.0

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: 05e500d1cfe48a8a50cb16f50f921c652887474b
4
- data.tar.gz: 5e7e36a9db0d0040d82048302004b9abde2438ed
3
+ metadata.gz: e099aac6272001aab6e3fffb631902017d72cb8e
4
+ data.tar.gz: d106ee5bcf7f0615811b82e3fc4c6215c7be673d
5
5
  SHA512:
6
- metadata.gz: 757b43c94fe0649d9a81130e8ec366a1ae537235493458ae4b6356f359b4fc389f617b98895e129823b826823b85928adfd9bc487f06cb503069a95edd6c8e5f
7
- data.tar.gz: 3fff06a332fa0c36678b048253a1dbdbbd8d8d17ec018b38584a953a141f27f77c6d1cb3a61dc3d153a869ee5191fd45d9f753eb222799a70ddb5dc132e08737
6
+ metadata.gz: 9352ff867f38cbcaf5b27223909d6793b71d593178e9e6071984e6ea9bd6baec885a5ffc203fe115a2c0bc10ff91bc3bbcf7f167a82a4c8a344ce61838e13b95
7
+ data.tar.gz: 5b6f37e8dd0a5e086ead5d8da592d49edaa6d282b5ee6ca4413350f0534df9e907f8450f64457f7ebba822f1e5277f0a40ff45675d84b28a6ec161cd802583e5
data/README.md CHANGED
@@ -14,6 +14,10 @@ gem 'lessonly-ruby'
14
14
 
15
15
  And then run `bundle install`.
16
16
 
17
+ ## Running tests
18
+
19
+ Run `rake ci` to run rubocop and rspec tests.
20
+
17
21
  ## Usage
18
22
 
19
23
  First, configure your client:
@@ -1,4 +1,7 @@
1
1
  module Lessonly
2
2
  class User < Resource
3
+ def assigned_to?(course)
4
+ course.assignments.map(&:assignee_id).include?(id)
5
+ end
3
6
  end
4
7
  end
@@ -1,3 +1,3 @@
1
1
  module Lessonly
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.0'
3
3
  end
data/spec/course_spec.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Lessonly::Course do
4
- context '#all' do
4
+ describe '#all' do
5
5
  it 'should return all courses' do
6
6
  courses = Lessonly::Course.all
7
7
  expect(courses.count).to eq 3
@@ -10,14 +10,14 @@ describe Lessonly::Course do
10
10
  end
11
11
  end
12
12
 
13
- context '#find' do
13
+ describe '#find' do
14
14
  it 'should find a single course' do
15
15
  course = Lessonly::Course.find(1)
16
16
  expect(course.title).to eq 'HIPAA Advanced'
17
17
  end
18
18
  end
19
19
 
20
- context '#lessons' do
20
+ describe '#lessons' do
21
21
  it 'should have many lessons' do
22
22
  course = Lessonly::Course.find(1)
23
23
 
@@ -26,7 +26,7 @@ describe Lessonly::Course do
26
26
  end
27
27
  end
28
28
 
29
- context '#assignments' do
29
+ describe '#assignments' do
30
30
  it 'should have many assignments' do
31
31
  course = Lessonly::Course.find(1)
32
32
  assignments = course.assignments
@@ -43,7 +43,7 @@ describe Lessonly::Course do
43
43
  end
44
44
  end
45
45
 
46
- context '#create_assignment' do
46
+ describe '#create_assignment' do
47
47
  it 'should create a user assignment' do
48
48
  course = Lessonly::Course.find(1)
49
49
  user = Lessonly::User.find(3)
@@ -55,7 +55,7 @@ describe Lessonly::Course do
55
55
  end
56
56
  end
57
57
 
58
- context '#destroy_assignment' do
58
+ describe '#destroy_assignment' do
59
59
  it 'should remove a user assignment' do
60
60
  course = Lessonly::Course.find(1)
61
61
  user = Lessonly::User.find(1)
data/spec/group_spec.rb CHANGED
@@ -1,21 +1,21 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Lessonly::Group do
4
- context '#all' do
4
+ describe '#all' do
5
5
  it 'should return all groups' do
6
6
  groups = Lessonly::Group.all
7
7
  expect(groups.count).to eq 1
8
8
  end
9
9
  end
10
10
 
11
- context '#find' do
11
+ describe '#find' do
12
12
  it 'should find a single group' do
13
13
  group = Lessonly::Group.find(1)
14
14
  expect(group.name).to eq 'Developers'
15
15
  end
16
16
  end
17
17
 
18
- context '#create_membership' do
18
+ describe '#create_membership' do
19
19
  it 'should add a user to the group\'s members' do
20
20
  group = Lessonly::Group.find(1)
21
21
  user = Lessonly::User.find(3)
@@ -27,7 +27,7 @@ describe Lessonly::Group do
27
27
  end
28
28
  end
29
29
 
30
- context '#destroy_membership' do
30
+ describe '#destroy_membership' do
31
31
  it 'should remove a user from the group\'s members' do
32
32
  group = Lessonly::Group.find(1)
33
33
  user = Lessonly::User.find(1)
data/spec/user_spec.rb CHANGED
@@ -1,17 +1,33 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Lessonly::User do
4
- context '#all' do
4
+ describe '#all' do
5
5
  it 'should return all users' do
6
6
  users = Lessonly::User.all
7
7
  expect(users.count).to eq 3
8
8
  end
9
9
  end
10
10
 
11
- context '#find' do
11
+ describe '#find' do
12
12
  it 'should find a single user' do
13
13
  user = Lessonly::User.find(1)
14
14
  expect(user.name).to eq 'Chas Ballew'
15
15
  end
16
16
  end
17
+
18
+ describe '#assigned_to?' do
19
+ it 'should return true if user is assigned to course' do
20
+ user = Lessonly::User.find(1)
21
+ course = Lessonly::Course.find(1)
22
+
23
+ expect(user.assigned_to?(course)).to eq true
24
+ end
25
+
26
+ it 'should return false if user is not assigned to course' do
27
+ user = Lessonly::User.find(3)
28
+ course = Lessonly::Course.find(1)
29
+
30
+ expect(user.assigned_to?(course)).to eq false
31
+ end
32
+ end
17
33
  end
metadata CHANGED
@@ -1,153 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lessonly-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Skylar Anderson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-21 00:00:00.000000000 Z
11
+ date: 2015-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sawyer
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.5.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.5.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: aptible-tasks
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: webmock
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: pry
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: sinatra
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  description: Ruby client for Lesson.ly API
@@ -157,9 +157,9 @@ executables: []
157
157
  extensions: []
158
158
  extra_rdoc_files: []
159
159
  files:
160
- - .gitignore
161
- - .rspec
162
- - .travis.yml
160
+ - ".gitignore"
161
+ - ".rspec"
162
+ - ".travis.yml"
163
163
  - Gemfile
164
164
  - LICENSE.md
165
165
  - Procfile
@@ -204,17 +204,17 @@ require_paths:
204
204
  - lib
205
205
  required_ruby_version: !ruby/object:Gem::Requirement
206
206
  requirements:
207
- - - '>='
207
+ - - ">="
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  required_rubygems_version: !ruby/object:Gem::Requirement
211
211
  requirements:
212
- - - '>='
212
+ - - ">="
213
213
  - !ruby/object:Gem::Version
214
214
  version: '0'
215
215
  requirements: []
216
216
  rubyforge_project:
217
- rubygems_version: 2.2.2
217
+ rubygems_version: 2.4.3
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: Ruby client for Lesson.ly API