wordpress-xmlrpc 0.0.7 → 0.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.
- data/VERSION +1 -1
- data/features/step_definitions/basic_steps.rb +1 -1
- data/lib/blog.rb +5 -0
- data/spec/blog_spec.rb +10 -1
- data/wordpress-xmlrpc.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.9
|
@@ -16,7 +16,7 @@ Then /^I should see "([^\"]*)"$/ do |expected_content|
|
|
16
16
|
end
|
17
17
|
|
18
18
|
Given /^I have a blog control$/ do
|
19
|
-
@blog = Wordpress::Blog.new(:blog_uri => "http://
|
19
|
+
@blog = Wordpress::Blog.new(:blog_uri => "http://testblog.artaxo-test-systems.de", :user => "admin", :password => "wordpress-xmlrpc")
|
20
20
|
end
|
21
21
|
|
22
22
|
When /^make following post:$/ do |table|
|
data/lib/blog.rb
CHANGED
@@ -38,11 +38,16 @@ module Wordpress
|
|
38
38
|
post.published = true
|
39
39
|
end #publish
|
40
40
|
|
41
|
+
# TODO: rename to "update"
|
41
42
|
def update_post(post)
|
42
43
|
process_post_images(post)
|
43
44
|
return api_call("metaWeblog.editPost", post.id, @user, @password, post.to_struct, post.published)
|
44
45
|
end #update_post
|
45
46
|
|
47
|
+
def delete(post)
|
48
|
+
return api_call("blogger.deletePost", "", post.id, @user, @password, true)
|
49
|
+
end
|
50
|
+
|
46
51
|
def upload_file(file)
|
47
52
|
struct = {
|
48
53
|
:name => File.basename(file.path),
|
data/spec/blog_spec.rb
CHANGED
@@ -46,7 +46,7 @@ describe Wordpress::Blog do
|
|
46
46
|
describe "api calls" do
|
47
47
|
before(:each) do
|
48
48
|
@client_mock = mock("client")
|
49
|
-
XMLRPC::Client.should_receive(:new2).with("http://localhost/xmlrpc").and_return(@client_mock)
|
49
|
+
XMLRPC::Client.should_receive(:new2).with("http://localhost/xmlrpc.php").and_return(@client_mock)
|
50
50
|
|
51
51
|
@blog = Wordpress::Blog.new(
|
52
52
|
:blog_uri => "http://localhost",
|
@@ -56,6 +56,15 @@ describe Wordpress::Blog do
|
|
56
56
|
)
|
57
57
|
end
|
58
58
|
|
59
|
+
describe "delete_post" do
|
60
|
+
it "should make appropriate call to xmlrpc api" do
|
61
|
+
@client_mock.should_receive(:call).with("blogger.deletePost", "", 123, "admin", "wordpress-xmlrpc", true).and_return(true)
|
62
|
+
|
63
|
+
post = Wordpress::Post.new(:id => 123)
|
64
|
+
@blog.delete(post).should be_true
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
59
68
|
describe "publish" do
|
60
69
|
it "should make appropriate call to xmlrpc api" do
|
61
70
|
images = [{:file_path => File.expand_path("./spec/support/files/post_picture.jpg")}]
|
data/wordpress-xmlrpc.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordpress-xmlrpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexander Naumenko
|