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
| page.driver.browser.switch_to.alert.accept |
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
| page.response_headers['Content-Type'].should == "application/gpx+xml" | |
| page.response_headers['Content-Disposition'].should =~ /attachment/ | |
| page.response_headers['Content-Disposition'].should =~ /#{@route.gpx_file_name}/ | |
| #if you can't stub a file create an upload | |
| filename = "lol.jpg" | |
| path = "#{Rails.root}/spec/fixtures/files/#{filename}" | |
| upload = ActionDispatch::Http::UploadedFile.new({ | |
| :filename => filename, |
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
| expect { some_method }.to raise_error |
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
| window.location.href = '...'; |
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
| #calendar table { | |
| border: 1px solid #dddddd; | |
| border-collapse: separate; | |
| border-left: 0; | |
| -webkit-border-radius: 4px; | |
| -moz-border-radius: 4px; | |
| border-radius: 4px; | |
| } | |
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
| #poltergeist/phantomjs only | |
| def take_screenshot filename = "screenshot" | |
| file = "#{Dir.pwd}/tmp/screenshots/#{filename}_#{Time.now.to_formatted_s(:number)}.png" | |
| page.driver.render(file, :full => true) | |
| puts "Saved screenshot: #{file}" | |
| 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
| def create | |
| user = User.find_by_email(params[:session][:email].downcase) | |
| if user && user.authenticate(params[:session][:password]) | |
| sign_in user | |
| redirect_to user | |
| else | |
| flash.now[:error] = 'Invalid email/password combination' | |
| render 'new' | |
| end | |
| 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
| cp -R dirtocopy/ newdir/ |
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
| source ~/.bashrc |
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
| @user.remove_avatar = true; | |
| @user.save! |