crowd_rest 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,4 +75,75 @@ describe CrowdRest::Session do
75
75
  @response.user.should be_a(CrowdRest::User)
76
76
  end
77
77
  end
78
+
79
+ describe ".validate(token)" do
80
+ context "given a valid session token" do
81
+ before(:all) do
82
+ login = CrowdRest::Session.create("crowduser", "crowdpass")
83
+ @response = CrowdRest::Session.validate(login.token)
84
+ end
85
+
86
+ it "responds successfully" do
87
+ @response.code.should == 200
88
+ end
89
+ end
90
+
91
+ context "given an invalid session token" do
92
+ before(:all) do
93
+ @response = CrowdRest::Session.validate("beefface")
94
+ end
95
+
96
+ it_behaves_like "a failed request"
97
+
98
+ it "does not respond successfuly" do
99
+ @response.code.should == 404
100
+ end
101
+ end
102
+ end
103
+
104
+ describe ".invalidate(token)" do
105
+ context "given a valid session token" do
106
+ before(:all) do
107
+ login = CrowdRest::Session.create("crowduser", "crowdpass")
108
+ @response = CrowdRest::Session.invalidate(login.token)
109
+ end
110
+
111
+ it "responds successfully" do
112
+ @response.code.should == 204
113
+ end
114
+ end
115
+
116
+ context "given an invalid session token" do
117
+ before(:all) do
118
+ @response = CrowdRest::Session.invalidate("beefface")
119
+ end
120
+
121
+ it "responds successfully" do
122
+ @response.code.should == 204
123
+ end
124
+ end
125
+ end
126
+
127
+ describe ".destroy(username)" do
128
+ context "given a valid username" do
129
+ before(:all) do
130
+ login = CrowdRest::Session.create("crowduser", "crowdpass")
131
+ @response = CrowdRest::Session.destroy("crowduser")
132
+ end
133
+
134
+ it "responds successfully" do
135
+ @response.code.should == 204
136
+ end
137
+ end
138
+
139
+ context "given an invalid username" do
140
+ before(:all) do
141
+ @response = CrowdRest::Session.destroy("beefface")
142
+ end
143
+
144
+ it "does not respond successfully" do
145
+ @response.code.should == 404
146
+ end
147
+ end
148
+ end
78
149
  end
metadata CHANGED
@@ -1,74 +1,88 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: crowd_rest
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
4
5
  prerelease:
5
- version: 0.0.2
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Justin Blake
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-05-18 00:00:00 -04:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: httparty
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.10.2
25
22
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: rspec
29
23
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.10.2
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
31
33
  none: false
32
- requirements:
33
- - - ">="
34
- - !ruby/object:Gem::Version
35
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
36
38
  type: :development
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: vcr
40
39
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: vcr
48
+ requirement: !ruby/object:Gem::Requirement
42
49
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: "0"
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
47
54
  type: :development
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: fakeweb
51
55
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: fakeweb
64
+ requirement: !ruby/object:Gem::Requirement
53
65
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: "0"
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
58
70
  type: :development
59
- version_requirements: *id004
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
60
78
  description: Ruby client for Atlassian's Crowd REST API. Word up.
61
- email:
79
+ email:
62
80
  - justin@hentzia.com
63
81
  executables: []
64
-
65
82
  extensions: []
66
-
67
83
  extra_rdoc_files: []
68
-
69
- files:
84
+ files:
70
85
  - .gitignore
71
- - .rvmrc
72
86
  - CHANGELOG.md
73
87
  - Gemfile
74
88
  - LICENSE
@@ -84,35 +98,31 @@ files:
84
98
  - spec/crowd_rest/user_spec.rb
85
99
  - spec/crowd_rest_spec.rb
86
100
  - spec/spec_helper.rb
87
- has_rdoc: true
88
101
  homepage: https://github.com/blaix/crowd_rest
89
102
  licenses: []
90
-
91
103
  post_install_message:
92
104
  rdoc_options: []
93
-
94
- require_paths:
105
+ require_paths:
95
106
  - lib
96
- required_ruby_version: !ruby/object:Gem::Requirement
107
+ required_ruby_version: !ruby/object:Gem::Requirement
97
108
  none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: "0"
102
- required_rubygems_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ! '>='
111
+ - !ruby/object:Gem::Version
112
+ version: '0'
113
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
114
  none: false
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- version: "0"
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
108
119
  requirements: []
109
-
110
120
  rubyforge_project: crowd_rest
111
- rubygems_version: 1.6.2
121
+ rubygems_version: 1.8.25
112
122
  signing_key:
113
123
  specification_version: 3
114
124
  summary: Ruby client for Atlassian's Crowd REST API
115
- test_files:
125
+ test_files:
116
126
  - spec/cassette_library/test_data.yml
117
127
  - spec/crowd_rest/session_spec.rb
118
128
  - spec/crowd_rest/user_spec.rb
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm 1.9.2@crowd_rest