```ruby
require 'rails_helper'

RSpec.feature 'Dashboard', type: :feature do
  scenario 'Guests are asked to log in first' do
    visit dashboards_show_path

    expect(current_path).to eq(root_path)
    expect(page).to flash_message t('not_logged_in')
  end
end
```

Use page object and corresponding matchers rather than looking at URL
user
```ruby
require 'rails_helper'

RSpec.feature 'Dashboard', type: :feature do
  scenario 'Guests are asked to log in first' do
    visit dashboards_show_path

    expect(page).to show :welcome_page
    expect(page).to flash_message t('not_logged_in')
  end
end
```
assistant