Sha256: 084c16d398b7c428e00827f4c788996b6c92e0e52771be0934be0fdd0dc4b933

Contents?: true

Size: 664 Bytes

Versions: 3

Compression:

Stored size: 664 Bytes

Contents

require 'spec_helper'

describe Konacha::SpecsController do
  before do
    @routes = Konacha::Engine.routes
  end

  describe "#iframe" do
    it "assigns the result of Spec.find to @specs" do
      Konacha::Spec.should_receive(:find).with("spec_path") { :spec }
      get :iframe, :path => "spec_path"
      assigns[:specs].should == :spec
    end

    it "404s if there is no match for the given path" do
      Konacha::Spec.should_receive(:find).with("array_spec") { raise Konacha::Spec::NotFound }
      get :iframe, :path => "array_spec"
      response.status.should == 404
      response.should_not render_template("konacha/specs/iframe")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
konacha-2.0.0.beta3 spec/controllers/specs_controller_spec.rb
konacha-2.0.0.beta2 spec/controllers/specs_controller_spec.rb
konacha-2.0.0.beta1 spec/controllers/specs_controller_spec.rb