Sha256: b28290d72ae3c994d1345abfb497f90f7bc36f7ae3c36fa448ef66e6216d15eb

Contents?: true

Size: 990 Bytes

Versions: 3

Compression:

Stored size: 990 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "find_anchors", :type => :controller do
  include Spec::Integration::DSL
  controller_name :integration_dsl
  
  before do
    response.stub!(:body).and_return %{<a href="/lala"></a>}
  end
  
  it "should find the anchor having the given href" do
    find_anchors('/lala').should_not be_nil
  end
  
  it "should violate when count is not as expected" do
    lambda do
      find_anchors('/lala', :count => 0)
    end.should raise_error(Spec::Expectations::ExpectationNotMetError)
  end
end

describe "have_navigated_successfully", :type => :controller do
  include Spec::Integration::DSL
  controller_name :integration_dsl
  
  it "should report the exception in the failure message" do
    with_routing do |set|; set.draw do |map|
      map.connect ':controller/:action/:id'
      get :exploding
      lambda do
        should have_navigated_successfully
      end.should fail_with(/This will blow up!/)
    end; end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radiant-0.7.2 vendor/plugins/spec_integration/spec/dsl/navigation_spec.rb
radiant-0.7.0 vendor/plugins/spec_integration/spec/dsl/navigation_spec.rb
radiant-0.7.1 vendor/plugins/spec_integration/spec/dsl/navigation_spec.rb