Sha256: 126f9fd974421c809b64fc3b85fd69a0e7d324b5746b3fdd19f0f923e912a480

Contents?: true

Size: 801 Bytes

Versions: 8

Compression:

Stored size: 801 Bytes

Contents

RSpec.describe PowerApi::GeneratorHelper::ResourceHelper, type: :generator do
  describe "#resource" do
    let(:resource) { generators_helper.resource }

    it_behaves_like('ActiveRecord resource')
    it_behaves_like('ActiveRecord resource attributes', :resource_attributes)
  end

  describe "#parent_resource" do
    let(:parent_resource_name) { "blog" }
    let(:resource) { generators_helper.parent_resource }

    it_behaves_like('ActiveRecord resource')
  end

  describe "#parent_resource?" do
    let(:parent_resource_name) { "blog" }

    def perform
      generators_helper.parent_resource?
    end

    it { expect(perform).to eq(true) }

    context "with no parent resource name" do
      let(:parent_resource_name) { nil }

      it { expect(perform).to eq(false) }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
power_api-2.1.1 spec/dummy/spec/lib/power_api/generator_helper/resource_helper_spec.rb
power_api-2.1.0 spec/dummy/spec/lib/power_api/generator_helper/resource_helper_spec.rb
power_api-2.0.2 spec/dummy/spec/lib/power_api/generator_helper/resource_helper_spec.rb
power_api-2.0.1 spec/dummy/spec/lib/power_api/generator_helper/resource_helper_spec.rb
power_api-2.0.0 spec/dummy/spec/lib/power_api/generator_helper/resource_helper_spec.rb
power_api-1.0.0 spec/dummy/spec/lib/power_api/generator_helper/resource_helper_spec.rb
power_api-0.2.0 spec/dummy/spec/lib/power_api/generator_helper/resource_helper_spec.rb
power_api-0.1.0 spec/dummy/spec/lib/power_api/generator_helper/resource_helper_spec.rb