From f483f73c0fba309a515811bce47c9db2cd0e09de Mon Sep 17 00:00:00 2001 From: megli2 Date: Sat, 24 Feb 2024 14:47:05 +0100 Subject: [PATCH] begin with testing --- spec/features/skills_controller_spec.rb | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 spec/features/skills_controller_spec.rb diff --git a/spec/features/skills_controller_spec.rb b/spec/features/skills_controller_spec.rb new file mode 100644 index 000000000..e3c063364 --- /dev/null +++ b/spec/features/skills_controller_spec.rb @@ -0,0 +1,27 @@ +require 'rails_helper' + +describe :people do + describe 'People Search', type: :feature, js: true do + + it 'can edit skill in table ' do + visit skills_path + + # list = Skill.pluck(:title).sort + # within 'section[data-controller="dropdown"]' do + # expect(page).to have_select('person_id', options: list, selected: list.first) + # end + end + + it 'redirects to the selected person on change' do + visit people_path + bob = skills(:bash) + + within 'section[data-controller="dropdown"]' do + select bob.name, from: 'person_id' + end + + expect(page).to have_current_path(person_path(bob)) + expect(page).to have_select('person_id', selected: bob.name) + end + end +end