Browse Source

Merge branch 'main' into invite_new_user

pull/126/head
baarkerlounger 4 years ago
parent
commit
e1b44cfdf7
  1. 6
      README.md
  2. 7
      app/views/layouts/application.html.erb
  3. 2
      config/locales/en.yml
  4. 2
      spec/features/test_spec.rb
  5. 6
      spec/features/user_spec.rb

6
README.md

@ -1,15 +1,13 @@
[![CI/CD Pipeline](https://github.com/communitiesuk/mhclg-data-collection-beta/actions/workflows/pipeline.yml/badge.svg?branch=main&event=push)](https://github.com/communitiesuk/mhclg-data-collection-beta/actions/workflows/pipeline.yml) [![CI/CD Pipeline](https://github.com/communitiesuk/mhclg-data-collection-beta/actions/workflows/pipeline.yml/badge.svg?branch=main&event=push)](https://github.com/communitiesuk/mhclg-data-collection-beta/actions/workflows/pipeline.yml)
# Data Collection App # Log social housing lettings and sales (CORE)
This is the codebase for the Ruby on Rails app that will handle the submission of Lettings and Sales of Social Housing in England data.
This is the codebase for the Ruby on Rails app that will handle the submission of lettings and sales of social housing data in England.
## API documentation ## API documentation
API documentation can be found here: https://communitiesuk.github.io/mhclg-data-collection-beta/. This is driven by [OpenAPI docs](docs/api/DLUHC-CORE-Data.v1.json) API documentation can be found here: https://communitiesuk.github.io/mhclg-data-collection-beta/. This is driven by [OpenAPI docs](docs/api/DLUHC-CORE-Data.v1.json)
## Required Setup ## Required Setup
Pre-requisites: Pre-requisites:

7
app/views/layouts/application.html.erb

@ -33,14 +33,15 @@
<%= govuk_header( <%= govuk_header(
logotype: 'GOV.UK', logotype: 'GOV.UK',
service_name: 'Share Lettings and Sales for Social Housing in England Data with DLUHC', service_name: t('service_name'),
service_url: '/' service_url: '/'
) do |component| ) do |component|
if current_user.nil? if current_user.nil?
component.navigation_item(text: 'Case logs', href: case_logs_path) component.navigation_item(text: 'Sign in', href: user_session_path)
elsif elsif
component.navigation_item(text: 'Case logs', href: case_logs_path)
component.navigation_item(text: 'Your organisation', href: "/organisations/#{current_user.organisation.id}") component.navigation_item(text: 'Your organisation', href: "/organisations/#{current_user.organisation.id}")
component.navigation_item(text: 'Your account', href: '/users/account') component.navigation_item(text: 'Your account', href: users_account_path)
component.navigation_item(text: 'Sign out', href: destroy_user_session_path, options: {:method => :delete}) component.navigation_item(text: 'Sign out', href: destroy_user_session_path, options: {:method => :delete})
end end
end end

2
config/locales/en.yml

@ -30,4 +30,4 @@
# available at https://guides.rubyonrails.org/i18n.html. # available at https://guides.rubyonrails.org/i18n.html.
en: en:
hello: "Hello world" service_name: "Log social housing lettings and sales (CORE)"

2
spec/features/test_spec.rb

@ -2,7 +2,7 @@ require "rails_helper"
RSpec.describe "Test Features" do RSpec.describe "Test Features" do
it "Displays the name of the app" do it "Displays the name of the app" do
visit("/") visit("/")
expect(page).to have_content("Share Lettings and Sales for Social Housing in England Data with DLUHC") expect(page).to have_content("Log social housing lettings and sales (CORE)")
end end
it "Links to the About page" do it "Links to the About page" do

6
spec/features/user_spec.rb

@ -87,12 +87,12 @@ RSpec.describe "User Features" do
it "Can navigate and sign in page with sign in button" do it "Can navigate and sign in page with sign in button" do
visit("/") visit("/")
expect(page).to have_link("Case logs") expect(page).to have_link("Sign in")
click_link("Case logs") click_link("Sign in")
fill_in("user[email]", with: user.email) fill_in("user[email]", with: user.email)
fill_in("user[password]", with: "pAssword1") fill_in("user[password]", with: "pAssword1")
click_button("Sign in") click_button("Sign in")
expect(page).to have_current_path("/case-logs") expect(page).to have_current_path("/")
end end
it "tries to access account page, redirects to log in page" do it "tries to access account page, redirects to log in page" do

Loading…
Cancel
Save