This file contains hidden or 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
# first one | |
item_step = Item.find(829).item_steps.first | |
bad_item_step_id = 829 | |
Attempt.where("attemptable_type = 'ItemStep' and attemptable_id = ?", bad_item_step_id).each do |a| | |
a.attemptable_id = item_step.id | |
if a.correct | |
a.response_id = item_step.correct_responses.first.id | |
else | |
a.response_id = item_step.incorrect_responses.first.id | |
end |
This file contains hidden or 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
= swf_tag "name_of_swf", \ | |
options={:dom_id => "dom_element", \ | |
:size => "320x240", :version => "10.1", \ | |
:flashvars => {"a" => "test"}, \ | |
:params => {"menu" => "false", "wmode" => "direct"}, \ | |
:attributes => { "align" => "left", "class" => "flash_css_class" }} | |
div(id="dom_element") |
This file contains hidden or 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
# WAIT! Do consider that `wait` may not be needed. This article describes | |
# that reasoning. Please read it and make informed decisions. | |
# https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/ | |
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
describe 'Modal' do | |
should 'display login errors' do | |
visit root_path |
This file contains hidden or 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
<div class="project img_project1"> | |
<div class="link-div"> | |
<object type="img/gif"> | |
<a class="lightbox" href="http://example.com/"> | |
<img src="/images/spacer.gif" alt="" width="100%" height="100%" /> | |
</a> | |
</object> | |
</div> | |
<h5>Project 1</h5> | |
<p>Description of the project.</p> |
This file contains hidden or 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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |