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') |
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
| In terminal: | |
| `lsof -wni tcp:3000` | |
| It show all running processes | |
| COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
| ruby 9666 dima 10u IPv4 65756 0t0 TCP 127.0.0.1:3000 (LISTEN) |
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
| # spec_helper.rb | |
| include Warden::Test::Helpers | |
| Warden.test_mode! | |
| # test_spec | |
| login_as(@user, scope: :user) |
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
| _ |
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
| _ |
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
| # Add to app/controllers/application_controller.rb | |
| if Rails.env.production? || Rails.env.staging? | |
| # https://api.rubyonrails.org/v4.2/classes/ActiveSupport/Rescuable/ClassMethods.html | |
| # https://api.rubyonrails.org/v5.2/classes/ActiveSupport/Rescuable/ClassMethods.html#method-i-rescue_from | |
| rescue_from Exception do |exception| | |
| render_error(exception, 500) | |
| end | |
| rescue_from ActionController::RoutingError, |
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
| Run rake secret to generate a new token. | |
| Now create a new file config/initializers/secret_token.rb and add the following: | |
| MyApp::Application.config.secret_key_base = '<token>' | |
| Replace <token> with the one you just generated and replace MyApp with the actual module name of your app. You can find the module name of your app at the top of config/environments/development.rb |
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
| sudo kill $(sudo lsof -t -i:3000) |
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
| sudo -u postgres createuser --superuser Myname |
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
| DROP MATERIALIZED VIEW [ IF EXISTS ] имя [, ...] [ CASCADE | RESTRICT ] |
NewerOlder