-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Final cleanup, version bump to 1.0.0.
- Loading branch information
Zach Feldman
committed
Jun 5, 2013
1 parent
dacb112
commit 61d9fba
Showing
18 changed files
with
266 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
*.tmp | ||
*.swp | ||
wordpress.yml | ||
*.swp |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ require 'rspec/core/rake_task' | |
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec | ||
task :default => :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module Post | ||
module Posts | ||
|
||
def getPost(options = {}) | ||
default_options = { | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe "#options" do | ||
|
||
let(:options){ { "blog_tagline" => "This is a great tagline" } } | ||
|
||
it "#getOptions" do | ||
VCR.use_cassette("getOptions") do | ||
CLIENT.getOptions.should include("time_zone" => {"desc"=>"Time Zone", "readonly"=>false, "value"=>"0"}) | ||
end | ||
end | ||
|
||
it "#setOptions" do | ||
VCR.use_cassette("setOptions") do | ||
CLIENT.setOptions({:options => options}).should include("blog_tagline" => {"desc"=>"Site Tagline", "readonly"=>false, "value"=>"This is a great tagline"}) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
describe "#users" do | ||
|
||
let(:edited_profile_content){ {:first_name => "Johnson"} } | ||
|
||
it "#getUsersBlogs" do | ||
VCR.use_cassette("getUsersBlogs") do | ||
CLIENT.getUsersBlogs[0].should include("blogid") | ||
end | ||
end | ||
|
||
it "#getUsers" do | ||
VCR.use_cassette("getUsers") do | ||
CLIENT.getUsers[0].should include("user_id") | ||
end | ||
end | ||
|
||
it "#getProfile" do | ||
VCR.use_cassette("getProfile") do | ||
CLIENT.getProfile.should include("user_id") | ||
end | ||
end | ||
|
||
it "#editProfile" do | ||
VCR.use_cassette("editProfile") do | ||
CLIENT.editProfile({:content => edited_profile_content}).should eq(true) | ||
end | ||
end | ||
|
||
it "#getAuthors" do | ||
VCR.use_cassette("getAuthors") do | ||
CLIENT.getAuthors[0].should include("user_id") | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require_relative 'spec_helper' | ||
|
||
describe "#client" do | ||
|
||
it '#initialize' do | ||
CLIENT.class.should == Rubypress::Client | ||
end | ||
|
||
it "#execute" do | ||
Rubypress::Client.any_instance.stub_chain(:connection, :call){ [{"user_id"=>"46917508", "user_login"=>"johnsmith", "display_name"=>"john"}, {"user_id"=>"33333367", "user_login"=>"johnsmith", "display_name"=>"johnsmith"}] } | ||
expect(CLIENT.execute("wp.getAuthors", {})).to eq( [{"user_id"=>"46917508", "user_login"=>"johnsmith", "display_name"=>"john"}, {"user_id"=>"33333367", "user_login"=>"johnsmith", "display_name"=>"johnsmith"}] ) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
describe "#comments" do | ||
|
||
let(:post_id){ 134 } | ||
let(:comment_id){ 1 } | ||
let(:comment){ {:comment_parent => "", :content => "This is a test thing here.", :author => "John Adams", :author_url => "http://johnadamsforpresidentnow.com", :author_email => "[email protected]"} } | ||
|
||
it "#getCommentCount" do | ||
VCR.use_cassette("getCommentCount") do | ||
CLIENT.getCommentCount({:post_id => post_id}).should include("approved" => "1") | ||
end | ||
end | ||
|
||
it "#getComment" do | ||
VCR.use_cassette("getComment") do | ||
CLIENT.getComment({:comment_id => comment_id}).should include("comment_id" => "1") | ||
end | ||
end | ||
|
||
it "#getComments" do | ||
VCR.use_cassette("getComments") do | ||
CLIENT.getComments[0].should include("post_id" => post_id.to_s) | ||
end | ||
end | ||
|
||
it "#newComment" do | ||
VCR.use_cassette("newComment") do | ||
CLIENT.newComment({:post_id => post_id, :comment => comment}).class.should eq(Fixnum) | ||
end | ||
end | ||
|
||
it "#editComment" do | ||
VCR.use_cassette("editComment") do | ||
CLIENT.editComment({:comment_id => comment_id, :comment => comment}).class.should eq(TrueClass) | ||
end | ||
end | ||
|
||
it "#deleteComment" do | ||
VCR.use_cassette("deleteComment") do | ||
CLIENT.deleteComment({:comment_id => comment_id}).class.should eq(TrueClass) | ||
end | ||
end | ||
|
||
it "#getCommentStatusList" do | ||
VCR.use_cassette("getCommentStatusList") do | ||
CLIENT.getCommentStatusList.should include("hold" => "Unapproved") | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
describe "#media" do | ||
|
||
let(:attachment_id){ 129 } | ||
let(:file){ {:id => "", :name => "test_file.png", :bits => '"\x89PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\n\x00\x00\x00\n\b\x03\x00\x00\x00\xBA\xEC?\x8F\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\xC9e<\x00\x00\x00\fPLTE\xAC\xAC\xAC\x87\x87\x87aaa\xFF\xFF\xFF\xF2\xB3\r\x90\x00\x00\x00\x04tRNS\xFF\xFF\xFF\x00@*\xA9\xF4\x00\x00\x004IDATx\xDAl\x8D1\x12\x00 \f\xC2\x02\xFE\xFF\xCF\x82\x0Eu0\x03\x97r\xD7\x96U\xDC\xE0\x98;\xE1@\xDB$ \xA7\xACJ\x1F\xD5h\xD0]{\x8E\xCD\x8B-\xC0\x00/\x88\x00\xDF$\xC9\x85\\\x00\x00\x00\x00IEND\xAEB`\x82"'}} | ||
|
||
it "#getMediaItem" do | ||
VCR.use_cassette("getMediaItem") do | ||
CLIENT.getMediaItem({:attachment_id => attachment_id}).should include("title" => "8yI9E3I") | ||
end | ||
end | ||
|
||
it "#getMediaLibrary" do | ||
VCR.use_cassette("getMediaLibrary") do | ||
CLIENT.getMediaLibrary[0].should include("attachment_id"=>"129") | ||
end | ||
end | ||
|
||
it "#uploadFile" do | ||
VCR.use_cassette("uploadFile") do | ||
CLIENT.uploadFile({:data => file}).should include("url" => "http://cthisisatest.files.wordpress.com/2013/06/test_file.png") | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
describe "#post" do | ||
|
||
let(:post_id){ 134 } | ||
let(:post){ {:post_type => "post", :post_status => "draft", :post_title => "5 Ways to Know You're Cool", :post_content => "I don't always write tests, but when I do, I use RSpec."} } | ||
let(:post_id_to_delete){ 137 } | ||
|
||
it "#getPost" do | ||
VCR.use_cassette("getPost") do | ||
CLIENT.getPost({:post_id => post_id}).should include("post_id" => "134") | ||
end | ||
end | ||
|
||
it "#getPosts" do | ||
VCR.use_cassette("getPosts") do | ||
CLIENT.getPosts[0].should include("post_id") | ||
end | ||
end | ||
|
||
it "#newPost" do | ||
VCR.use_cassette("newPost") do | ||
CLIENT.newPost({:content => post}).should =~ STRING_NUMBER_REGEX | ||
end | ||
end | ||
|
||
it "#editPost" do | ||
VCR.use_cassette("editPost") do | ||
CLIENT.editPost({:post_id => post_id, :content => post}).should eq(true) | ||
end | ||
end | ||
|
||
it "#deletePost" do | ||
VCR.use_cassette("deletePost") do | ||
CLIENT.deletePost({:post_id => post_id_to_delete}).should eq(true) | ||
end | ||
end | ||
|
||
it "#getPostType" do | ||
VCR.use_cassette("getPostType") do | ||
CLIENT.getPostType({:post_type_name => "post"}).should include("name"=>"post") | ||
end | ||
end | ||
|
||
it "#getPostTypes" do | ||
VCR.use_cassette("getPostTypes") do | ||
CLIENT.getPostTypes.should include("page") | ||
end | ||
end | ||
|
||
it "#getPostFormats" do | ||
VCR.use_cassette("getPostFormats") do | ||
CLIENT.getPostFormats.should include("image" => "Image") | ||
end | ||
end | ||
|
||
it "#getPostStatusList" do | ||
VCR.use_cassette("getPostStatusList") do | ||
CLIENT.getPostStatusList.should include("standard"=>"Standard") | ||
end | ||
end | ||
|
||
end |
Oops, something went wrong.