Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from EventideSystems/9-simplify-template-check…
Browse files Browse the repository at this point in the history
…list-model-feature-specs

9 update feature specs
  • Loading branch information
ferrisoxide authored Apr 24, 2024
2 parents bf5c050 + f74ac10 commit 908170b
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 22 deletions.
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ GEM
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lookbook (2.2.2)
lookbook (2.3.0)
activemodel
css_parser
htmlbeautifier (~> 1.3)
Expand All @@ -215,7 +215,7 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.0.0)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.22.3)
msgpack (1.7.2)
Expand Down Expand Up @@ -298,17 +298,17 @@ GEM
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rb_sys (0.9.94)
rb_sys (0.9.97)
rdoc (6.6.3.1)
psych (>= 4.0.0)
recaptcha (5.16.0)
redcarpet (3.6.0)
redis (5.1.0)
redis-client (>= 0.17.0)
redis-client (0.22.0)
redis (5.2.0)
redis-client (>= 0.22.0)
redis-client (0.22.1)
connection_pool
regexp_parser (2.9.0)
reline (0.5.1)
reline (0.5.2)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
Expand All @@ -332,7 +332,7 @@ GEM
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rubocop (1.63.1)
rubocop (1.63.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -410,7 +410,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
view_component (3.12.0)
view_component (3.12.1)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/landing_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<h1 class="mt-10 text-4xl font-bold tracking-tight text-white sm:text-6xl">Deploy to the cloud with confidence</h1>
<p class="mt-6 text-lg leading-8 text-gray-300">Anim aute id magna aliqua ad ad non deserunt sunt. Qui irure qui lorem cupidatat commodo. Elit sunt amet fugiat veniam occaecat fugiat aliqua.</p>
<div class="mt-10 flex items-center gap-x-6">
<a href="#" class="rounded-md bg-indigo-500 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-400">Get started</a>
<%= link_to 'Get started', new_user_registration_path, class: "rounded-md bg-indigo-500 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-400" %>
<%= link_to new_user_session_path, class: 'text-sm font-semibold leading-6 text-white' do %>
Already have an account? Sign in <span aria-hidden="true"></span>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/landing_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</head>

<body class="h-full">
<%= render 'layouts/shared/flash_messages' %>
<%= yield %>
</body>
</html>
2 changes: 2 additions & 0 deletions features/onboarding/orientation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ When I log in for the first time
And I visit my workspace page
Then a checklist named "Introduction to Obsekio" will be present in my workspace

@javascript
Scenario: Opening up the "Introduction to Obsekio" checklist
Given I am logged in
And a checklist named "Introduction to Obsekio" exists in my workspace
When I open the checklist named "Introduction to Obsekio"
And I click on the "Account Settings" link in the checklist
Then will be redirected to the account settings page

@javascript
Scenario: Checking off the "Introduction to Obsekio" checklist
Given I am logged in
And a checklist named "Introduction to Obsekio" exists in my workspace
Expand Down
6 changes: 0 additions & 6 deletions features/onboarding/sign_up.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@ Scenario: User signs up with invalid information
And I click the sign up button
Then I should see an error message
And I should still be on the sign up page






4 changes: 4 additions & 0 deletions features/step_definitions/onboarding_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
end

When('I click the link in the confirmation email') do
Timeout.timeout(10) do
sleep(1) until ActionMailer::Base.deliveries.present?
end

deliveries = ActionMailer::Base.deliveries
confirmation_instructions = deliveries.detect { |mail| mail['subject'].value == 'Confirmation instructions' }
expect(confirmation_instructions).to be_present
Expand Down
21 changes: 16 additions & 5 deletions features/step_definitions/workspace_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@
end

When('I open the checklist named {string}') do |string|
click_on(string)
Capybara.page.current_window.resize_to(1980, 1000) # SMELL: move this to a step definition
find('a', text: string).click
end

When('I click on the {string} checklist item') do |string|
find('input[type="checkbox"]') do |checkbox|
checkbox.sibling('p').text == string
element = find('input[type="checkbox"]') do |checkbox|
parent_element = checkbox.find(:xpath, '..')
text_nodes = parent_element.text.split("\n")
text_nodes.include?(string)
end

expect(element).to be_present
element.click
sleep(1) # TODO: Remove this and wait for the page to load properly
end

When('I click on the {string} link in the checklist') do |string|
Expand All @@ -27,7 +34,11 @@
end

Then('the {string} checklist item will be marked as checked') do |string|
find('input[type="checkbox"]') do |checkbox|
checkbox.sibling('p').text == string
element = find('input[type="checkbox"]') do |checkbox|
parent_element = checkbox.find(:xpath, '..')
text_nodes = parent_element.text.split("\n")
text_nodes.include?(string)
end

expect(element.checked?).to be_truthy
end
11 changes: 10 additions & 1 deletion features/templates/checklists/admin_user_specific.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@ Then the template called "New Template" should be saved in the library
Then I should be taken to the template checklist view page

Scenario: Admin user edits a template checklist
Given I am a logged in as an admin user
And a draft template checklist called "New Template" exists
When I click on "Edit" for the "New Template" template checklist
And I fill in the form with the following information:
| templates_checklist_title | Updated Template |
And I click on "Save"
Then the template called "Updated Template" should be saved in the library
Then I should be taken to the template checklist view page


Scenario: Admin user deletes a template checklist
Scenario: Admin user archives a template checklist

Scenario: Admin user publishes a template checklist
Given I am a logged in as an admin user
Expand Down

0 comments on commit 908170b

Please sign in to comment.