Skip to content

Commit

Permalink
Merge pull request #112 from bmic-development/wth-show-button-bug
Browse files Browse the repository at this point in the history
wth - (SPARCRequest & SPARCDashboard) Additional Details 500 Error on
  • Loading branch information
Stuart-Johnson committed Feb 23, 2017
2 parents c19a1d4 + 588d9a7 commit a3b3e9f
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/controllers/additional_details/previews_controller.rb
Expand Up @@ -19,6 +19,7 @@
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.~

class AdditionalDetails::PreviewsController < ApplicationController
before_action :authenticate_identity!

def create
@service = Service.find(params[:service_id])
Expand Down
Expand Up @@ -19,6 +19,7 @@
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.~

class AdditionalDetails::QuestionnairesController < ApplicationController
before_action :authenticate_identity!
before_action :find_service
before_action :find_questionnaire, only: [:edit, :update, :destroy]
layout 'additional_details'
Expand Down
@@ -1,4 +1,5 @@
class AdditionalDetails::SubmissionsController < ApplicationController
before_action :authenticate_identity!
layout 'additional_details'
include AdditionalDetails::StatesHelper

Expand Down
Expand Up @@ -19,6 +19,7 @@
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.~

class AdditionalDetails::UpdateQuestionnairesController < ApplicationController
before_action :authenticate_identity!

def update
@service = Service.find(params[:service_id])
Expand Down
Expand Up @@ -7,6 +7,9 @@
%h4.list-group-item-heading
= item.content
%p.list-group-item-text
= qr.content.delete('[]').delete('\"')
- if item.item_type == 'multiple_dropdown'
= qr.content.delete('[]').delete('\"')
- else
= qr.content
- unless item == @items.last
%hr
Expand Up @@ -21,6 +21,9 @@
require 'rails_helper'

RSpec.describe AdditionalDetails::PreviewsController do
stub_controller
let!(:logged_in_user) { create(:identity) }

describe '#create' do
before :each do
@service = create( :service )
Expand Down Expand Up @@ -54,4 +57,4 @@

it { is_expected.to respond_with :ok }
end
end
end
Expand Up @@ -21,6 +21,9 @@
require 'rails_helper'

RSpec.describe AdditionalDetails::QuestionnairesController do
stub_controller
let!(:logged_in_user) { create(:identity) }

describe '#destroy' do
before :each do
@service = create(:service)
Expand Down
Expand Up @@ -21,6 +21,9 @@
require 'rails_helper'

RSpec.describe AdditionalDetails::QuestionnairesController do
stub_controller
let!(:logged_in_user) { create(:identity) }

describe '#edit' do
before :each do
@service = create(:service)
Expand Down
Expand Up @@ -21,6 +21,9 @@
require 'rails_helper'

RSpec.describe AdditionalDetails::QuestionnairesController do
stub_controller
let!(:logged_in_user) { create(:identity) }

describe '#index' do
before :each do
@service = create(:service)
Expand Down
Expand Up @@ -21,6 +21,9 @@
require 'rails_helper'

RSpec.describe AdditionalDetails::QuestionnairesController do
stub_controller
let!(:logged_in_user) { create(:identity) }

describe '#new' do
before :each do
@service = create(:service)
Expand All @@ -43,4 +46,4 @@

it { is_expected.to respond_with(:ok) }
end
end
end
Expand Up @@ -21,6 +21,9 @@
require 'rails_helper'

RSpec.describe AdditionalDetails::QuestionnairesController do
stub_controller
let!(:logged_in_user) { create(:identity) }

describe '#create' do
before :each do
@service = create(:service)
Expand Down Expand Up @@ -119,4 +122,4 @@
it { is_expected.to respond_with(:ok) }
end
end
end
end
Expand Up @@ -21,6 +21,9 @@
require 'rails_helper'

RSpec.describe AdditionalDetails::QuestionnairesController do
stub_controller
let!(:logged_in_user) { create(:identity) }

describe '#update' do
before :each do
@service = create(:service)
Expand Down
Expand Up @@ -21,6 +21,9 @@
require 'rails_helper'

RSpec.describe AdditionalDetails::UpdateQuestionnairesController do
stub_controller
let!(:logged_in_user) { create(:identity) }

describe '#update' do
before :each do
@service = create(:service)
Expand Down
Expand Up @@ -23,6 +23,7 @@
RSpec.describe 'User has multiple questionnaires that can be activated', js: true do

let_there_be_lane
fake_login_for_each_test

before(:each) do
@service = create(:service_with_ctrc_organization)
Expand Down
Expand Up @@ -22,6 +22,8 @@

RSpec.describe 'User creates an additional details questionnaire', js: true do
let_there_be_lane
fake_login_for_each_test

scenario 'successfully' do
service = create(:service, :with_ctrc_organization)
visit new_service_additional_details_questionnaire_path(service)
Expand Down
Expand Up @@ -2,6 +2,8 @@

RSpec.describe 'User should see error - no questions created', js: true do
let_there_be_lane
fake_login_for_each_test

scenario 'successfully' do
service = create(:service, :with_ctrc_organization)
visit new_service_additional_details_questionnaire_path(service)
Expand Down
Expand Up @@ -22,6 +22,8 @@

RSpec.describe 'User should see service questionnaire index', js: true do
let_there_be_lane
fake_login_for_each_test

scenario 'successfully' do
service = create(:service, :with_ctrc_organization)
questionnaire = create(:questionnaire,
Expand Down
@@ -1,6 +1,9 @@
require 'rails_helper'

RSpec.describe 'User should see validation errors on item content', js: true do
let_there_be_lane
fake_login_for_each_test

scenario 'successfully' do
service = create(:service, :with_ctrc_organization)
visit new_service_additional_details_questionnaire_path(service)
Expand Down

0 comments on commit a3b3e9f

Please sign in to comment.