Skip to content

Commit

Permalink
revise position specs to match updated app design
Browse files Browse the repository at this point in the history
  • Loading branch information
christinalcole committed Sep 9, 2017
1 parent db297bf commit 60b38e2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
21 changes: 9 additions & 12 deletions spec/features/position_features_spec.rb
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
require 'rails_helper'

RSpec.feature 'Position Management' do
context 'nested resource' do
it 'has an index page nested under a user' do
RSpec.feature 'Users and Positions', type: :feature do
context 'as a logged-in user' do
it 'has an add-position page nested under a user' do
user = create(:user)
visit user_positions_path(user.id)
visit new_user_position_path(user.id)
expect(page.status_code).to eq(200)
end
it 'lists the positions of the logged-in user'
end

context 'user wants to add positions to their profile' do
scenario 'there is a link to add new position(s)' do
visit user_position_path
user = create(:user)
visit user_path(user.id)
expect(page).to have_link("Add Crew Positions")
end
scenario 'there is no link to add position(s) if a user profile already has positions'
scenario 'there is a form to add new position(s)' do
visit user_position_path
visit user_path
click_link("Add Crew Positions")
expect(page).to have(css"form#new_position")
end
scenario 'the form should display existing positions in the db' do
position = create(:position)
visit new_user_position_path
expect(page).to have_content(postion.name)
end
scenario 'the form should display existing positions in the db'
scenario 'the user should gain new position(s) after the form is submitted'
end

Expand All @@ -36,4 +32,5 @@
scenario 'the form should display positions already listed in the user profile'
scenario 'the list of positions for a user should update after the form is submitted'
end

end
10 changes: 10 additions & 0 deletions spec/features/positions/position_management_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'rails_helper'

RSpec.feature 'Positions Management', type: :feature do
context 'create positions' do
scenario 'a new position can be added to the db'
scenario 'an existing position can be updated'
scenario 'an existing position can be removed'
scenario 'existing positions in the database can be listed'
end
end
13 changes: 13 additions & 0 deletions spec/features/users/user_features_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'rails_helper'

RSpec.feature "User Management" type: :feature do
scenario "user can view a list of positions add to their account" do
@user = FactoryGirl.create(:user_with_positions)

visit user_path(@user)
expect(page).to have_content(@user.skills[0].name)
expect(page).to have_content(@user.skills[1].name)
end

end
end

0 comments on commit 60b38e2

Please sign in to comment.