Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

Summary of changes

  • Added 12 unit tests to test/models/space_test.rb covering validation, feature_enabled? method, and enabled_features getter/setter
  • Added 5 integration tests to test/controllers/static_controller_test.rb verifying per-space feature toggling in navigation UI
  • Tests verify space isolation: disabling features in one space doesn't affect other spaces or the default space

Motivation and context

Tests the recently added disabled_features field functionality on the Space model. Ensures features can be toggled per-space and validates proper isolation between spaces.

Space Model Tests (space_test.rb):

  • Field validation (defaults, valid/invalid features, edge cases)
  • feature_enabled? logic for disabled/enabled features and fallback to global config
  • enabled_features getter/setter complement operations

Controller Integration Tests (static_controller_test.rb):

  • Navigation tabs respect space-specific disabled_features
  • Multiple spaces maintain independent feature configurations
  • Directory menu integration with disabled features

Example test verifying space isolation:

test 'different spaces can have different disabled features' do
  plants_space.disabled_features = ['events']
  astro_space.disabled_features = ['materials']
  
  # plants space: events hidden, materials shown
  # astro space: events shown, materials hidden
end

Screenshots

N/A

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree
    to license it to the TeSS codebase under the
    BSD license.
Original prompt

Write some tests for the new disabled_features field of the Space model. Make sure to add some tests to static_controller_test.rb to check the features can be toggled on/off and do not affect other spaces


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: fbacall <503373+fbacall@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests for disabled_features field in Space model Add tests for Space model disabled_features field Dec 22, 2025
Copilot AI requested a review from fbacall December 22, 2025 17:35
@fbacall fbacall marked this pull request as ready for review December 22, 2025 18:05
@fbacall fbacall merged commit 264f3ce into spaces-feature-toggle Dec 22, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants