Sha256: aae75cd4fe58687450df52bf6c3cc1485138d673f5ca32e228b018c883435057

Contents?: true

Size: 1.21 KB

Versions: 52

Compression:

Stored size: 1.21 KB

Contents

require "spec_helper"

describe "Document Templates" do
  let(:data) do
    {
      title: "Epic Example",
      status: "published",
      type: "epic",
      features:[{
        title: "A user wants to do something",
        paragraph: "As a user I would like to do something so that I can succeed",
        goal: "I can succeed",
        persona: "user",
        behavior: "do something"
      },{
        title: "A user wants to do something else",
        paragraph: "As a user I would like to do something else so that I can succeed"
      }]
    }
  end

  it "has template body" do
    expect(Brief::Epic.template_body).not_to be_empty
  end

  it "has an example" do
    expect(Brief::Epic.example_body).not_to be_empty
  end

  it "takes a hash of data and renders yaml frontmatter" do
    expect(Brief::Document.create_from_data(data).title).to eq("Epic Example")
  end

  it "supports more complex renderings" do
    doc = Brief::Document.create_from_data(data)
    content = doc.content

    expect(content).to include("# Features")
    expect(content).to include("# Epic Example")
    expect(content).to include("## A user wants to do something")
    expect(content).to include("## A user wants to do something else")
  end

end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
brief-1.17.14 spec/lib/brief/template_spec.rb
brief-1.17.13 spec/lib/brief/template_spec.rb
brief-1.17.12 spec/lib/brief/template_spec.rb
brief-1.17.11 spec/lib/brief/template_spec.rb
brief-1.17.10 spec/lib/brief/template_spec.rb
brief-1.17.9 spec/lib/brief/template_spec.rb
brief-1.17.8 spec/lib/brief/template_spec.rb
brief-1.17.7 spec/lib/brief/template_spec.rb
brief-1.17.5 spec/lib/brief/template_spec.rb
brief-1.17.4 spec/lib/brief/template_spec.rb
brief-1.17.3 spec/lib/brief/template_spec.rb
brief-1.17.2 spec/lib/brief/template_spec.rb
brief-1.17.1 spec/lib/brief/template_spec.rb
brief-1.17.0 spec/lib/brief/template_spec.rb
brief-1.16.2 spec/lib/brief/template_spec.rb
brief-1.16.1 spec/lib/brief/template_spec.rb
brief-1.16.0 spec/lib/brief/template_spec.rb
brief-1.15.5 spec/lib/brief/template_spec.rb
brief-1.15.4 spec/lib/brief/template_spec.rb
brief-1.15.3 spec/lib/brief/template_spec.rb