wp-api-client
wp-api-client copied to clipboard
WpApiClient::Collection: Added accessor to get total pages for a cust…
WpApiClient::Collection: Added accessor to get total pages for a custom post_type posts
@duncanjbrown Could review ?
Thank you! Would you mind adding a spec?
@duncanjbrown added spec please review..
WpApiClient::Collection
fetching posts of a certain post type
returns an array of posts
can paginate
accepts array and non-array input
responds to array methods
should respond to total_pages and total_available
should respond to total_pages and total_available
WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<WpApiClient::ErrorResponse: WpApiClient::ErrorResponse>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /Users/mohan/WorkSpace/playground/wp-api-client/spec/collection_spec.rb:53:in `block (3 levels) in <top (required)>'.
throws an error when it tries to parse an error response
WpApiClient::Collection
fetching posts concurrently
allows simultaneous fetching of posts
WpApiClient::Entities::Base
general entity methods
work to retrieve embedded hypermedia
work to retrieve non-embedded hypermedia
allows querying on specific relations from posts to terms
allows querying on specific relations from terms to posts
WpApiClient::Entities::Error
an API access error
throws an exception
recognises the error JSON exception
WpApiClient::Entities::Image
calling instance methods on an image object
returns the URL for different sizes
WpApiClient::Entities::Post
calling instance methods on a post
returns the title
returns the date as a Time object
returns the content as HTML
returns its own ID
returns its own slug
allows its internal resource to be queried directly
returns its author
meta function
returns an individual meta value
caches
returns the right items from cache
WpApiClient::Relationship
relationships with terms
presents term objects as a set of key/value collections
relationships with posts
returns an collection of posts
relationships with featured images
returns an collection of posts
relationships with metadata
returns an hash of meta
WpApiClient::Entities::Taxonomy
calling instance methods on a taxonomy
returns the name
returns a collection of terms
WpApiClient::Entities::Term
reading data out of the term
returns the name
returns the slug
returns a taxonomy object
a term connected to two different post types
returns two collections of posts
WpApiClient::Entities::User
calling instance methods on a user
returns the id
WpApiClient
has a version number
WpApiClient::Configuration
#configure
can set the endpoint URL for the API connection
can specify whether or not to request embedded resources
can set up OAuth credentials
can set up link relationships
exposes a #proxy configuration option
Finished in 0.40895 seconds (files took 0.64956 seconds to load)
42 examples, 0 failures
@duncanjbrown Please find rspec result in https://travis-ci.org/gadikotamohan/wp-api-client
@duncanjbrown made suggested changes to code and please find rpsec status in https://travis-ci.org/gadikotamohan/wp-api-client/builds/556100532 (all specs are green)
Hi @duncanjbrown got a chance to look into this ?
hi @duncanjbrown, have you got a chance to look into this PR ?