2017 week 2 Flashcards
How do you rename a heroku app from the command line?
heroku rename your_app_rename
Applications in Heroku consist of what 3 things?
Your source code, a description of any dependencies, and a Procfile.
Describe what a locator in Rspec is?
A locator allows you to find an element on a webpage and then act on it with a test
When using the xpath tag, what does // mean? What would it mean if there was just / ?
The / refers to the root html tag
The // allows you to have access to all the html tags at once
When using xpath, how do you locate something by an attribute?
You put the @ sign in front If you want to find by an id @id If you want to find by a class @class etc.
What is the current_path Capybara helper and when would you use it?
Assert you landed somewhere
expect(current_path).to eq rails_admin.dashboard_path expect(current_path).to eq rails_admin.new_path(model_name: 'blog~post') expect(current_path).to eq rails_admin.edit_path(model_name: 'blog~post', id: post.id)
What is the difference between let vs let! in RSpec
Note that let is lazy-evaluated: it is not evaluated until the first time the method it defines is invoked.
You can use let! to force the method’s
invocation before each example