Sha256: f1cb900bbb9e473bc10acbd8625576fe83e72d6f4d0814965b7b71edd1fb3915

Contents?: true

Size: 1.23 KB

Versions: 14

Compression:

Stored size: 1.23 KB

Contents

require 'helper'

describe Desk::Client do
  context "Topic" do

    let(:endpoint) { "topic" }
    let(:id) { 1 }
    let(:check_key) { "name" }
    let(:check_value) { "Customer Support" }

    include_context "basic configuration"

    it_behaves_like "a list endpoint"

    it_behaves_like "a show endpoint"

    it_behaves_like "a create endpoint", { :name => "Social Media" }

    it_behaves_like "an update endpoint", { :name => "New Name" } do
      let(:check_value) { "New Name" }
    end

    it_behaves_like "a delete endpoint"

    context "Translation" do

      let(:sub_endpoint) { "translation" }
      let(:sub_id) { "en_us" }
      let(:check_key) { "name" }
      let(:check_value) { "Customer Support" }

      it_behaves_like "a sub list endpoint"

      it_behaves_like "a sub show endpoint"

      it_behaves_like "a sub create endpoint", {
        :name => "Japanese",
        :locale => "ja"
      } do
        let(:check_value) { "Japanese" }
      end

      it_behaves_like "a sub update endpoint", {
        :name => "Updated Japanese Translation"
      } do
        let(:sub_id) { "ja" }
        let(:check_value) { "Updated Japanese Translation" }
      end

      it_behaves_like "a sub delete endpoint"

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
desk-1.2.0 spec/desk/client/topic_spec.rb
desk-1.1.1 spec/desk/client/topic_spec.rb
desk-1.1.0 spec/desk/client/topic_spec.rb
desk-1.0.10 spec/desk/client/topic_spec.rb
desk-1.0.9 spec/desk/client/topic_spec.rb
desk-1.0.8 spec/desk/client/topic_spec.rb
desk-1.0.7 spec/desk/client/topic_spec.rb
desk-1.0.6 spec/desk/client/topic_spec.rb
desk-1.0.5 spec/desk/client/topic_spec.rb
desk-1.0.4 spec/desk/client/topic_spec.rb
desk-1.0.3 spec/desk/client/topic_spec.rb
desk-1.0.2 spec/desk/client/topic_spec.rb
desk-1.0.1 spec/desk/client/topic_spec.rb
desk-1.0.0 spec/desk/client/topic_spec.rb