Sha256: f41774b9cca88bf0d366b27c62cb5c7b7331ee3b90c4d63160f8154f6aea0bae

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

require "spec_helper"

RSpec.describe Ribose::Profile do
  describe ".fetch" do
    it "retrieves the current user profile" do
      stub_ribose_fetch_profile_api
      profile = Ribose::Profile.fetch

      expect(profile.id).not_to be_nil
      expect(profile.first_name).to eq("John")
      expect(profile.name).to eq("John Doe")
    end
  end

  describe ".updates" do
    it "updates teh current user profile" do
      attributes = { frest_name: "John", last_name: "Doe" }

      stub_ribose_update_profile_api(attributes)
      profile = Ribose::Profile.update(attributes)

      expect(profile.id).not_to be_nil
      expect(profile.name).to eq("John Doe")
    end
  end

  describe ".set_login" do
    it "sets the login for the current user" do
      user_id = "63116bd1"
      login = "new_login_name"

      stub_ribose_fetch_profile_api
      stub_ribose_set_login_name_api(user_id, login)
      profile = Ribose::Profile.set_login(login)

      expect(profile.id).not_to be_nil
      expect(profile.name).to eq("John Doe")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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