Sha256: ce065b0806dfc31e9be3be803f4fc30306ed77b0e0ec092546ca3203f4422b22

Contents?: true

Size: 895 Bytes

Versions: 9

Compression:

Stored size: 895 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"))

    view.stub(:javascript_include_tag)
    view.should_receive(:javascript_include_tag).with("a_spec")

    render
  end

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

    view.should_receive(:stylesheet_link_tag).with("foo", :debug => false)
    view.should_receive(:stylesheet_link_tag).with("bar", :debug => false)

    render
  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

9 entries across 9 versions & 1 rubygems

Version Path
konacha-3.1.0 spec/views/specs/iframe.html.erb_spec.rb
konacha-3.0.0 spec/views/specs/iframe.html.erb_spec.rb
konacha-2.7.0 spec/views/specs/iframe.html.erb_spec.rb
konacha-2.6.0 spec/views/specs/iframe.html.erb_spec.rb
konacha-2.5.1 spec/views/specs/iframe.html.erb_spec.rb
konacha-2.5.0 spec/views/specs/iframe.html.erb_spec.rb
konacha-2.4.0 spec/views/specs/iframe.html.erb_spec.rb
konacha-2.3.0 spec/views/specs/iframe.html.erb_spec.rb
konacha-2.2.0 spec/views/specs/iframe.html.erb_spec.rb