|
7 | 7 | end
|
8 | 8 |
|
9 | 9 | Then /^I should see the following resources:$/ do |table|
|
10 |
| - all("h2").map(&:text).should == table.raw.flatten |
| 10 | + expect(all("h2").map(&:text)).to eq(table.raw.flatten) |
11 | 11 | end
|
12 | 12 |
|
13 | 13 | Then /^I should see the following parameters:$/ do |table|
|
14 | 14 | names = all(".parameters .name").map(&:text)
|
15 | 15 | descriptions = all(".parameters .description").map(&:text)
|
16 | 16 |
|
17 |
| - names.zip(descriptions).should == table.rows |
| 17 | + expect(names.zip(descriptions)).to eq(table.rows) |
18 | 18 | end
|
19 | 19 |
|
20 | 20 | Then(/^I should see the following response fields:$/) do |table|
|
21 | 21 | names = all(".response-fields .name").map(&:text)
|
22 | 22 | descriptions = all(".response-fields .description").map(&:text)
|
23 | 23 |
|
24 |
| - names.zip(descriptions).should == table.rows |
| 24 | + expect(names.zip(descriptions)).to eq(table.rows) |
25 | 25 | end
|
26 | 26 |
|
27 | 27 | Then /^I should see the following (request|response) headers:$/ do |part, table|
|
28 | 28 | actual_headers = page.find("pre.#{part}.headers").text
|
29 | 29 | expected_headers = table.raw.map { |row| row.join(": ") }
|
30 | 30 |
|
31 | 31 | expected_headers.each do |row|
|
32 |
| - actual_headers.should include(row.strip) |
| 32 | + expect(actual_headers).to include(row.strip) |
33 | 33 | end
|
34 | 34 | end
|
35 | 35 |
|
|
38 | 38 | expected_headers = table.raw.map { |row| row.join(": ") }
|
39 | 39 |
|
40 | 40 | expected_headers.each do |row|
|
41 |
| - actual_headers.should_not include(row.strip) |
| 41 | + expect(actual_headers).to_not include(row.strip) |
42 | 42 | end
|
43 | 43 | end
|
44 | 44 |
|
45 | 45 | Then /^I should see the route is "([^"]*)"$/ do |route|
|
46 |
| - page.should have_css(".request.route", :text => route) |
| 46 | + expect(page).to have_css(".request.route", :text => route) |
47 | 47 | end
|
48 | 48 |
|
49 | 49 | Then /^I should see the following query parameters:$/ do |table|
|
50 | 50 | text = page.find("pre.request.query_parameters").text
|
51 | 51 | actual = text.split("\n")
|
52 | 52 | expected = table.raw.map { |row| row.join(": ") }
|
53 | 53 |
|
54 |
| - actual.should =~ expected |
| 54 | + expect(actual).to match(expected) |
55 | 55 | end
|
56 | 56 |
|
57 | 57 | Then /^I should see the response status is "([^"]*)"$/ do |status|
|
58 |
| - page.should have_css(".response.status", :text => status) |
| 58 | + expect(page).to have_css(".response.status", :text => status) |
59 | 59 | end
|
60 | 60 |
|
61 | 61 | Then /^I should see the following request body:$/ do |request_body|
|
62 |
| - page.should have_css("pre.request.body", :text => request_body) |
| 62 | + expect(page).to have_css("pre.request.body", :text => request_body) |
63 | 63 | end
|
64 | 64 |
|
65 | 65 | Then /^I should see the following response body:$/ do |response_body|
|
66 |
| - page.should have_css("pre.response.body", :text => response_body) |
| 66 | + expect(page).to have_css("pre.response.body", :text => response_body) |
67 | 67 | end
|
68 | 68 |
|
69 | 69 | Then /^I should see the api name "(.*?)"$/ do |name|
|
70 | 70 | title = find("title").text
|
71 | 71 | header = find("h1").text
|
72 | 72 |
|
73 |
| - title.should eq(name) |
74 |
| - header.should eq(name) |
| 73 | + expect(title).to eq(name) |
| 74 | + expect(header).to eq(name) |
75 | 75 | end
|
0 commit comments