spec/unit/endpoints_spec.rb in ayadn-3.0 vs spec/unit/endpoints_spec.rb in ayadn-4.0
- old
+ new
@@ -1,25 +1,97 @@
require 'spec_helper'
describe Ayadn::Endpoints do
before do
Ayadn::Settings.stub(:user_token).and_return('XXX')
- Ayadn::Settings.stub(:options).and_return({
+ Ayadn::Settings.stub(:options).and_return(
+ Ayadn::Preferences.new(
+ {
+ timeline: {
+ directed: true,
+ source: true,
+ symbols: true,
+ name: true,
+ date: true,
+ debug: false,
+ compact: false
+ },
+ marker: {
+ messages: true
+ },
counts: {
- unified: 33,
default: 100,
- conversations: 12
+ unified: 33,
+ global: 100,
+ checkins: 100,
+ conversations: 12,
+ photos: 100,
+ trending: 100,
+ mentions: 100,
+ convo: 100,
+ posts: 100,
+ messages: 20,
+ search: 200,
+ whoreposted: 20,
+ whostarred: 20,
+ whatstarred: 100,
+ files: 100
},
- timeline: {
- directed: 1,
- html: 0,
- annotations: 1
+ formats: {
+ table: {
+ width: 75,
+ borders: true
+ },
+ list: {
+ reverse: true
+ }
+ },
+ channels: {
+ links: true
+ },
+ colors: {
+ id: :blue,
+ index: :red,
+ username: :green,
+ name: :magenta,
+ date: :cyan,
+ link: :yellow,
+ dots: :blue,
+ hashtags: :cyan,
+ mentions: :red,
+ source: :cyan,
+ symbols: :green,
+ unread: :cyan,
+ debug: :red,
+ excerpt: :green
+ },
+ backup: {
+ posts: false,
+ messages: false,
+ lists: false
+ },
+ scroll: {
+ spinner: true,
+ timer: 3,
+ date: false
+ },
+ nicerank: {
+ threshold: 2.1,
+ filter: true,
+ unranked: false
+ },
+ nowplaying: {},
+ blacklist: {
+ active: true
}
- })
- Ayadn::Settings.stub(:global).and_return({
+ }))
+ global_hash = {
scrolling: false,
force: false
- })
+ }
+ Ayadn::Settings.stub(:global).and_return(
+ JSON.parse(global_hash.to_json, object_class: OpenStruct)
+ )
end
describe '#token_info' do
it "returns the Token url" do
expect(Ayadn::Endpoints.new.token_info).to eq 'https://api.app.net/token/?access_token=XXX'
end