Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- describe "check Edit tools" do
- context "click Edit and exercise Edit tools" do
- it "should affect the display upon clicking each Edit tool" do
- def toolbar_button_should_insert(button, inserted_text)
- @current_page.article_text_element.clear
- @current_page.send("#{button}_element").click
- @current_page.article_text.should include inserted_text
- end
- visit_page(ProofreadPage)
- @current_page.text.should include "This page has not been proofread"
- @current_page.edit
- @current_page.text.should include "Warning: You are not logged in"
- # TODO: I'm guessing the next 2 checks are to make sure the change to edit mode
- # succeeded. Find out intent of author, then maybe move or rename.
- @current_page.article_text.should be_true
- #checking Bold button
- @current_page.bold.should be_true
- button_effect_map = {
- "bold" => "'''Bold text'''",
- "italic" => "''Italic text''",
- "embedded" => "[[File:Example.jpg]]",
- "signature" => "--~~~~",
- }
- button_effect_map.each {
- |button, inserted_text| toolbar_button_should_insert button, inserted_text
- }
- end
- end
- end #describe
Add Comment
Please, Sign In to add comment