Sha256: 76229dcd16468e4f0e82d2685d8ed751dd2d6852a5921d87d1391ecc741623e9

Contents?: true

Size: 651 Bytes

Versions: 37

Compression:

Stored size: 651 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

shared_examples_for "categorizable interface" do
  let!(:category) { create(:category, participatory_space: model.participatory_space) }

  describe "category" do
    let(:query) { "{ category { id } }" }

    context "when model has category" do
      before do
        model.update(category: category)
      end

      it "has a category" do
        expect(response).to include("category" => { "id" => category.id.to_s })
      end
    end

    context "when model has no category" do
      it "returns null" do
        expect(response).to include("category" => nil)
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
decidim-core-0.27.9 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.8 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.7 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.6 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.26.10 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.26.9 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.5 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.26.8 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.4 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.3 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.26.7 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.26.5 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.2 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.1 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.26.4 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.0 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.26.3 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.0.rc2 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.27.0.rc1 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb
decidim-core-0.26.2 lib/decidim/core/test/shared_examples/categorizable_interface_examples.rb