Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions spec/features/navigation_bar_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require "rails_helper"

feature ' user see content of navigation bar' do
context 'navigation bar' do
let(:user) { create(:user, name: 'sima', email: '[email protected]')}
before do
login_as(user, scope: :user)
visit root_path
end

it 'display all navigation link ' do
expect(page).to have_link 'CA Mailboxer'
expect(page).to have_link 'Hello, sima'
expect(page).to have_link 'Inbox'
expect(page).to have_link 'Logout'
end

end

end
19 changes: 6 additions & 13 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
require 'spec_helper'
require 'coveralls'
Coveralls.wear_merged!('rails')

ENV['RAILS_ENV'] ||= 'test'

require File.expand_path('../config/environment', __dir__)

abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'rspec/rails'

begin
ActiveRecord::Migration.maintain_test_schema!
rescue
ActiveRecord::PendingMigrationError => e
rescue ActiveRecord::PendingMigrationError => e
puts e.to_s.strip
exit 1
end

RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!
config.include FactoryBot::Syntax::Methods
end

Shoulda::Matchers.configure do |config|
config.include Warden::Test::Helpers
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end

end
end