1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/spec
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
..
fixtures fix feature definition in case user has RSpec set not to expose dsl globally - test in rspec 3 beta tests 2014-04-03 10:25:03 -07:00
rspec Allow RSpec view specs to leverage Capybara matchers 2015-06-05 14:46:32 -04:00
basic_node_spec.rb fix for issue #1524 2015-05-28 10:51:23 -07:00
capybara_spec.rb rename default_wait_time to default_max_wait_time - Issue #1442 2015-04-23 10:18:16 -07:00
dsl_spec.rb rename default_wait_time to default_max_wait_time - Issue #1442 2015-04-23 10:18:16 -07:00
rack_test_spec.rb Tests for Node#send_keys 2015-01-23 12:23:22 -08:00
result_spec.rb fix feature definition in case user has RSpec set not to expose dsl globally - test in rspec 3 beta tests 2014-04-03 10:25:03 -07:00
rspec_spec.rb fix feature definition in case user has RSpec set not to expose dsl globally - test in rspec 3 beta tests 2014-04-03 10:25:03 -07:00
selenium_spec.rb fill_options: {clear: :backspace} should only be tested for selenium 2015-04-12 20:32:12 -07:00
selenium_spec_chrome.rb run chrome test separately once 2015-05-22 12:05:23 -07:00
server_spec.rb fix feature definition in case user has RSpec set not to expose dsl globally - test in rspec 3 beta tests 2014-04-03 10:25:03 -07:00
spec_helper.rb check correct version string for rspec composable 2014-09-19 11:41:09 -07:00