Refactor code for RSpec3 expect syntax incorporation

Bug: T68369
Change-Id: I25e27d8b363957c4217eaf8516d3c9e61ece156e
This commit is contained in:
jagori 2014-12-11 17:29:59 +11:00 committed by Physikerwelt
parent 7ae2e74309
commit 197bd9ccd6
2 changed files with 5 additions and 5 deletions

View File

@ -15,8 +15,8 @@ Feature: Math
Scenario: Display simple math
Given I am logged in
And I am at page that does not exist
And I click link Create source
When I type <math>3 + 2</math>
When I click link Create source
And I type <math>3 + 2</math>
And I click Preview
Then the page should contain an img tag
And alt for that img should be 3 + 2

View File

@ -27,14 +27,14 @@ When(/^I type (.+)$/) do |write_text|
end
Then(/^alt for that img should be (.+)$/) do |alt|
on(EditPage).math_image_element.element.alt.should == alt
expect(on(EditPage).math_image_element.element.alt).to eq(alt)
end
Then(/^src for that img should come from (.+)$/) do |src|
on(EditPage).math_image_element.element.src.should match Regexp.escape(src)
expect(on(EditPage).math_image_element.element.src).to match Regexp.escape(src)
end
Then(/^the page should contain an img tag$/) do
on(EditPage).math_image_element.when_present.should be_visible
expect(on(EditPage).math_image_element.when_present).to be_visible
end