Guest User

Untitled

a guest
Oct 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1.  
  2. require 'spec_helper'
  3.  
  4. describe "check Edit tools" do
  5. context "click Edit and exercise Edit tools" do
  6. it "should affect the display upon clicking each Edit tool" do
  7. def toolbar_button_should_insert(button, inserted_text)
  8. @current_page.article_text_element.clear
  9. @current_page.send("#{button}_element").click
  10. @current_page.article_text.should include inserted_text
  11. end
  12.  
  13. visit_page(ProofreadPage)
  14. @current_page.text.should include "This page has not been proofread"
  15. @current_page.edit
  16. @current_page.text.should include "Warning: You are not logged in"
  17.  
  18. # TODO: I'm guessing the next 2 checks are to make sure the change to edit mode
  19. # succeeded. Find out intent of author, then maybe move or rename.
  20.  
  21. @current_page.article_text.should be_true
  22. #checking Bold button
  23. @current_page.bold.should be_true
  24.  
  25. button_effect_map = {
  26. "bold" => "'''Bold text'''",
  27. "italic" => "''Italic text''",
  28. "embedded" => "[[File:Example.jpg]]",
  29. "signature" => "--~~~~",
  30. }
  31. button_effect_map.each {
  32. |button, inserted_text| toolbar_button_should_insert button, inserted_text
  33. }
  34. end
  35. end
  36.  
  37. end #describe
Add Comment
Please, Sign In to add comment