Sha256: 4d5e7cb6125f61b0d272ecfa119b1900bdac9bf8d1f0fa952d011483d375b611

Contents?: true

Size: 576 Bytes

Versions: 1

Compression:

Stored size: 576 Bytes

Contents

require 'spec_helper'

describe Wherelink::Matchers::LinkToMatcher do
  describe "have_link_to matcher" do
    let(:html) { '<a href="/foo/bar">Just a link</a>' }

    it "gives proper description" do
      have_link_to('/foo/bar').description.should == "have link to \"/foo/bar\""
    end

    it "passes if there is such a link" do
      html.should have_link_to('/foo/bar')
    end

    it "fails if there is no such link" do
      expect do
        html.should have_link_to('/bar/foo')
      end.to raise_error(/expected to find a link to "\/bar\/foo"/)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wherelink-matchers-0.0.1 spec/wherelink/matchers/have_link_to_spec.rb