Sha256: 824800185daa93c0375ea582333a2f8a3e9c58b0431c5d3ffff18d7f1ed6ec1e

Contents?: true

Size: 843 Bytes

Versions: 1

Compression:

Stored size: 843 Bytes

Contents

require 'spec_helper'

describe "konacha/specs/iframe" do
  before do
    assign(:stylesheets, [])
  end

  def spec_double(asset_name)
    double("spec called '#{asset_name}'", :asset_name => asset_name, :path => "#{asset_name}.js")
  end

  it "renders a script tag for @spec" do
    assign(:spec, spec_double("a_spec"))

    render

    rendered.should have_selector("script[src='/assets/a_spec.js']")
  end

  it "renders the stylesheets" do
    assign(:spec, spec_double("a_spec"))
    assign(:stylesheets, %w(foo bar))

    render

    rendered.should have_selector("link[href='/assets/foo.css']")
    rendered.should have_selector("link[href='/assets/bar.css']")
  end

  it "includes a path data attribute" do
    assign(:spec, spec_double("a_spec"))

    render

    rendered.should have_selector("[data-path='a_spec.js']")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
konacha-2.1.0 spec/views/specs/iframe.html.erb_spec.rb