Simplify selenium setup

This commit is contained in:
Samuel Cochran 2015-01-17 15:08:13 +11:00
parent 640d3710ae
commit 841c3a2ef3

View File

@ -45,13 +45,11 @@ describe MailCatcher do
end
def selenium
@selenium ||= begin
Selenium::WebDriver.for(:phantomjs).tap do |selenium|
selenium.navigate.to("http://127.0.0.1:#{HTTP_PORT}")
end
end
@selenium ||= Selenium::WebDriver.for(:phantomjs)
end
before { selenium.navigate.to("http://127.0.0.1:#{HTTP_PORT}") }
def messages_element
selenium.find_element(:id, "messages")
end
@ -96,8 +94,6 @@ describe MailCatcher do
selenium.find_element(:tag_name, "body")
end
before { selenium.navigate.refresh }
it "catches and displays a plain text message as plain text and source" do
deliver_example("plainmail")