Created
April 8, 2010 15:14
-
-
Save wheresalice/360169 to your computer and use it in GitHub Desktop.
rspec file to check the basics of a Drupal site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'watir' | |
require 'spec' | |
Watir::Browser.default = 'firefox' | |
describe "test Drupal frontend" do | |
before(:each) do | |
@browser ||= Watir::Browser.new | |
@domain ||= 'example.org' | |
@http ||= 'http' | |
end | |
describe "that anonymous users can't run update.php" do | |
it "should return Access denied" do | |
@browser.goto(@http + '://' + @domain + '/update.php') | |
@browser.text.should include('Access denied') | |
end | |
end | |
describe "that the frontpage shouldn't show warnings or errors" do # the describe() is an example group | |
it "shouldn't show warnings" do # the it() represents the detail that will be expressed in the code within the block | |
@browser.goto(@http + '://' + @domain) | |
@browser.text.should_not include('warning:') | |
end | |
it "shouldn't show errors" do | |
@browser.goto(@http + '://' + @domain) | |
@browser.text.should_not include('error:') | |
end | |
end | |
after(:each) do | |
@browser.close unless @browser.nil? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment