nakamura 0.8 → 0.9

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.
Files changed (2) hide show
  1. data/lib/nakamura/test.rb +13 -6
  2. metadata +10 -5
data/lib/nakamura/test.rb CHANGED
@@ -91,20 +91,27 @@ module SlingTest
91
91
 
92
92
  def wait_for_indexer()
93
93
  magic_content = "#{uniqueness()}_#{rand(1000).to_s}"
94
- filename = "wait_for_indexer_#{magic_content}"
95
-
96
- fm = SlingFile::FileManager.new(@s)
97
- fm.upload_pooled_file(filename, magic_content, 'text/plain')
98
-
94
+ path = "~admin/private/wait_for_indexer_#{magic_content}"
95
+ urlpath = @s.url_for(path)
96
+ res = @s.execute_post(urlpath, {
97
+ "sling:resourceType" => "sakai/widget-data",
98
+ "sakai:indexed-fields" => "foo",
99
+ "foo" => magic_content
100
+ })
101
+ assert(res.code.to_i >= 200 && res.code.to_i < 300, "Expected to be able to create node #{res.body}")
99
102
  # Give the indexer up to 20 seconds to catch up, but stop waiting early if
100
103
  # we find our test item has landed in the index.
101
104
  20.times do
102
- res = @s.execute_get(@s.url_for("/var/search/files/allfiles.json?q=#{filename}"))
105
+ res = @s.execute_get(@s.url_for("/var/search/pool/all.json?q=#{magic_content}"))
103
106
  if JSON.parse(res.body)["total"] != 0
104
107
  break
105
108
  end
106
109
  sleep(1)
107
110
  end
111
+ res = @s.execute_post(urlpath, {
112
+ ":operation" => "delete"
113
+ })
114
+ assert(res.code.to_i >= 200 && res.code.to_i < 300, "Expected to be able to delete node #{res.body}")
108
115
  end
109
116
 
110
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakamura
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.8'
4
+ version: '0.9'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-06 00:00:00.000000000 Z
12
+ date: 2012-06-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &11895320 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,12 @@ dependencies:
21
21
  version: 1.6.3
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *11895320
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.6.3
25
30
  description: Ruby library for interacting with Sakai Nakamura. Provides convenience
26
31
  methods for adding users and groups and other similar tasks.
27
32
  email: oae-dev@collab.sakaiproject.org
@@ -60,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
65
  requirements:
61
66
  - none
62
67
  rubyforge_project:
63
- rubygems_version: 1.8.10
68
+ rubygems_version: 1.8.21
64
69
  signing_key:
65
70
  specification_version: 3
66
71
  summary: Ruby library for interacting with Sakai Nakamura.