Sha256: 9de41294629247f850e49d4ad2eb132b1bf4666530191f31bc13ee16ced0fda9

Contents?: true

Size: 1.26 KB

Versions: 3

Compression:

Stored size: 1.26 KB

Contents

require "spec_helper"

describe "The Briefcase" do
  let(:briefcase) { Brief.testcase }

  it "has a root path" do
    expect(briefcase.root).to be_exist
  end

  it "has a cache key" do
    expect(briefcase.cache_key).not_to be_nil
  end

  it "has a slug" do
    expect(briefcase.slug).to eq("example")
  end

  it "points to a file repository" do
    expect(briefcase.repository).to be_a(Brief::Repository)
  end

  it "defines methods which combine models in arbitrary ways" do
    expect(briefcase.custom_aggregator).to be_a(Hash)
  end

  it "reads the settings.yml" do
    expect(briefcase.settings.settings).to be_present
  end

  # Need to improve this
  context "Model Loading" do
    it "loads the model definitions from the models and the apps folder" do
      expect(Brief::Model.classes).not_to be_empty
    end

    it "loads the model definitions from the DSL in the config file" do
      expect(Brief::Model.classes).not_to be_empty
    end

    it "caches the output" do
      object_id = briefcase.epics.object_id
      expect(briefcase.epics.object_id).to eq(object_id)
    end
  end

  context "Document Mappings" do
    it "has all of the documents" do
      expect(briefcase.epics.length).to eq(1)
      expect(briefcase.documents.length).to eq(8)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
brief-1.8.5 spec/lib/brief/briefcase_spec.rb
brief-1.8.4 spec/lib/brief/briefcase_spec.rb
brief-1.8.3 spec/lib/brief/briefcase_spec.rb