1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
Commit graph

6 commits

Author SHA1 Message Date
Thomas Walpole
e320f5d7fc style updates 2018-07-16 15:04:52 -07:00
Thomas Walpole
a17e9c36fa Add rubocop-spec - some disabled for now 2018-04-30 18:00:16 -07:00
Thomas Walpole
618dd9ff70 Rubocop driven spec style cleanup 2018-03-01 11:44:55 -08:00
Thomas Walpole
6356719043 Proxy all/within to the correct version based on parameters passed 2017-04-11 17:15:15 -07:00
Thomas Walpole
07e7777425 frozen literal magic comment 2016-03-07 16:52:19 -08:00
Joshua Clayton
08a200b138 Allow RSpec view specs to leverage Capybara matchers
Capybara provides a number of helpful matchers for asserting against a
DOM structure with various selectors. RSpec's view specs focus on
asserting against specific markup; this change ensures this is easier
to do.

    RSpec.describe "todos/show.html.erb", type: :view do
      it "displays the todo title" do
        assign :todo, Todo.new(title: "Buy milk")

        render

        # without Capybara matchers - potentially ambiguous, doesn't
        # test markup, only raw text rendered
        expect(rendered).to contain "Buy milk"

        # with Capybara matchers
        expect(rendered).to have_css("header h1", text: "Buy milk")
      end
    end
2015-06-05 14:46:32 -04:00