Browse Source

Add a feature spec for tab switching

pull/122/head
baarkerlounger 4 years ago
parent
commit
8a9d30e14e
  1. 29
      spec/features/organisation_spec.rb

29
spec/features/organisation_spec.rb

@ -0,0 +1,29 @@
require "rails_helper"
require_relative "form/helpers"
RSpec.describe "User Features" do
include Helpers
let!(:user) { FactoryBot.create(:user) }
let(:organisation) { user.organisation }
let(:org_id) { organisation.id }
before do
sign_in user
end
context "Organisation page" do
it "default to organisation details" do
visit("/case_logs")
click_link("Organisation")
expect(page).to have_content(user.organisation.name)
end
it "can switch tabs" do
visit("/organisations/#{org_id}")
click_link("Users")
expect(page).to have_current_path("/organisations/#{org_id}/users")
click_link("Details")
expect(page).to have_current_path("/organisations/#{org_id}/details")
end
end
end
Loading…
Cancel
Save