Sha256: 072cd92ce14dcee631d8127fe0415a8d29442cb3b849ed0cf85992711dafe6ea

Contents?: true

Size: 806 Bytes

Versions: 7

Compression:

Stored size: 806 Bytes

Contents

require "spec_helper"

RSpec.describe Ribose::AppRelation do
  describe ".all" do
    it "retrieves the list og user's app relations" do
      stub_ribose_app_relation_list_api
      app_relations = Ribose::AppRelation.all

      expect(app_relations.count).to eq(5)
      expect(app_relations.first.app_name).to eq("app/home")
      expect(app_relations.first.owner_id).to eq("63116bd1-c08d")
    end
  end

  describe ".fetch" do
    it "fetches a specific app realtation details" do
      relation_id = 123_456_789

      stub_ribose_app_relation_find_api(relation_id)
      app_relation = Ribose::AppRelation.fetch(relation_id)

      expect(app_relation.id).to eq(relation_id)
      expect(app_relation.owner_type).to eq("User")
      expect(app_relation.app_name).to eq("app/home")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ribose-0.5.0 spec/ribose/app_relation_spec.rb
ribose-0.4.1 spec/ribose/app_relation_spec.rb
ribose-0.4.0 spec/ribose/app_relation_spec.rb
ribose-0.3.2 spec/ribose/app_relation_spec.rb
ribose-0.3.1 spec/ribose/app_relation_spec.rb
ribose-0.3.0 spec/ribose/app_relation_spec.rb
ribose-0.2.0 spec/ribose/app_relation_spec.rb