repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/jobs/lessons/import_all_content_job_spec.rb
spec/jobs/lessons/import_all_content_job_spec.rb
require 'rails_helper' RSpec.describe Lessons::ImportAllContentJob do subject(:job) { described_class.new } describe '#perform' do before do allow(Github::LessonContentImporter).to receive(:import_all) end it 'delegates to the lesson content importer service' do job.perform expect(...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/interview_survey_spec.rb
spec/system/interview_survey_spec.rb
require 'rails_helper' RSpec.describe 'Interview survey' do let(:user) { create(:user) } before do sign_in(user) end context 'when the feature is enabled' do before do Flipper.enable(:survey_feature) end it 'shows the survey' do visit new_interview_survey_path expect(page)....
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/user_settings_spec.rb
spec/system/user_settings_spec.rb
require 'rails_helper' RSpec.describe 'User Profile' do let!(:user) do create( :user, username: 'Jeremy Beagle', email: 'jezza@beagle.com', learning_goal: 'Learn JavaScript', password: 'password' ) end before do sign_in(user) visit edit_users_profile_path end d...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/select_path_spec.rb
spec/system/select_path_spec.rb
require 'rails_helper' RSpec.describe 'Selecting Paths' do let!(:default_path) { create(:path, title: 'Foundations', default_path: true) } let!(:rails_path) { create(:path, title: 'Rails') } let!(:user) { create(:user, path: default_path) } before do sign_in(user) end context 'when on the paths index...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/user_notification_spec.rb
spec/system/user_notification_spec.rb
require 'rails_helper' RSpec.describe 'User Notifications' do let!(:flag) { create(:flag, project_submission:) } let(:project_submission) { create(:project_submission, lesson:, user: submission_owner) } let(:lesson) { create(:lesson, is_project: true, accepts_submission: true, previewable: true) } let(:submiss...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/lesson_completion_spec.rb
spec/system/lesson_completion_spec.rb
require 'rails_helper' RSpec.describe 'Lesson Completions' do let!(:user) { create(:user) } let!(:lesson) { create(:lesson) } context 'when user is signed in' do before do sign_in(user) visit lesson_path(lesson) end it 'can complete a lesson' do find(:test_id, 'complete-button').c...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/lesson_navigation_spec.rb
spec/system/lesson_navigation_spec.rb
require 'rails_helper' RSpec.describe 'Navigating Lessons' do let!(:course) { create(:course, path: create(:path, default_path: true)) } let!(:section) { create(:section, position: 1, course:) } let!(:lesson) { create(:lesson, position: 1, section:) } before do sign_in(create(:user)) end describe 'th...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/all_lesson_project_submissions_spec.rb
spec/system/all_lesson_project_submissions_spec.rb
require 'rails_helper' RSpec.describe 'View all Project Submissions for a Lesson' do let(:user) { create(:user) } context 'when the lesson accepts project submissions' do let(:lesson) { create(:lesson, :project) } it 'paginates the results' do create_list(:project_submission, 25, lesson:) # rubocop...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/course_lesson_completion_spec.rb
spec/system/course_lesson_completion_spec.rb
require 'rails_helper' RSpec.describe 'Course Lesson Completions' do let!(:user) { create(:user) } let!(:path) { create(:path, default_path: true) } let!(:course) { create(:course, path:) } let!(:section) { create(:section, course:) } context 'when user is signed in' do before do create(:lesson, s...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/course_progress_badge_spec.rb
spec/system/course_progress_badge_spec.rb
require 'rails_helper' RSpec.describe 'Course Progress Badge' do let!(:path) { create(:path, default_path: true) } let!(:course) { create(:course, path:) } let!(:first_lesson) { create(:lesson, course:) } let!(:second_lesson) { create(:lesson, course:) } context 'when signed in' do before do sign_...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/sign_up_spec.rb
spec/system/sign_up_spec.rb
require 'rails_helper' RSpec.describe 'Sign Up' do let!(:default_path) { create(:path, title: 'Foundations', default_path: true) } before do visit root_path find(:test_id, 'nav-sign-up').click end context 'when using email and password to sign up' do it 'signs up successfully' do find(:test...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/sign_in_spec.rb
spec/system/sign_in_spec.rb
require 'rails_helper' RSpec.describe 'Sign in' do let!(:user) { create(:user, email: 'odinstudent@example.com') } context 'when using an email and password' do it 'allows the user to sign in' do visit root_path find(:test_id, 'nav-sign-in').click find(:test_id, 'email-field').fill_in(with...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/user_reset_progress_spec.rb
spec/system/user_reset_progress_spec.rb
require 'rails_helper' RSpec.describe 'User Reset Progress' do let!(:user) { create(:user) } let!(:foundations_path) { create(:path, title: 'Foundations', default_path: true) } let!(:foundation_course) { create(:course, title: 'Foundations', path: foundations_path) } let!(:rails_path) { create(:path, title: 'R...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/admin/sign_in_and_out_spec.rb
spec/system/admin/sign_in_and_out_spec.rb
require 'rails_helper' RSpec.describe 'Admin sign in and sign out' do describe 'sign in' do context 'with valid credentials' do it 'signs the admin user in' do admin_user = create(:admin_user) visit admin_root_path fill_in 'Email', with: admin_user.email fill_in 'Password'...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/admin/flags_spec.rb
spec/system/admin/flags_spec.rb
require 'rails_helper' RSpec.describe 'Admin flags' do let!(:flag) { create(:flag, project_submission:) } let(:project_submission) { create(:project_submission, lesson:, user: submission_owner) } let(:lesson) { create(:lesson, is_project: true, accepts_submission: true, previewable: true) } let(:submission_own...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/admin/reactivations_spec.rb
spec/system/admin/reactivations_spec.rb
require 'rails_helper' RSpec.describe 'Admin team members reactivations' do it 'reactivates a team member' do admin = create(:admin_user, :activated) deactivated_admin = create(:admin_user, :deactivated, email: 'deactivated@admin.com') sign_in(admin) visit admin_team_path sleep 0.1 # dropdown a...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/admin/invitations_spec.rb
spec/system/admin/invitations_spec.rb
require 'rails_helper' RSpec.describe 'Admin invitations' do it 'invites a new team member' do sign_in(create(:admin_user)) # Create a new invitation visit admin_team_path click_on('Invite new member') fill_in('Name', with: 'John Doe') fill_in('Email', with: 'john@example.com') select(...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/admin/deactivations_spec.rb
spec/system/admin/deactivations_spec.rb
require 'rails_helper' RSpec.describe 'Admin team member deactivation' do it 'deactivates a team member' do admin = create(:admin_user, :activated) other_admin = create(:admin_user, :activated, email: 'otheradmin@odin.com', password: 'password') sign_in(admin) visit admin_team_path sleep 0.1 # ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/admin/learners_spec.rb
spec/system/admin/learners_spec.rb
require 'rails_helper' RSpec.describe 'Admin learners' do before do sign_in(create(:admin_user)) create(:user, username: 'John', email: 'john@email.com') create(:user, username: 'Jane', email: 'jane@email.com') end it 'can search for learners' do visit admin_learners_path fill_in 'search_t...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/admin/announcements_spec.rb
spec/system/admin/announcements_spec.rb
require 'rails_helper' RSpec.describe 'Admin announcements' do before do sign_in(create(:admin_user)) visit admin_flags_path end context 'when creating a new announcement' do it 'displays the announcement message and expires at on the index page' do visit admin_announcements_path click_o...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/user_dashboard/start_course_spec.rb
spec/system/user_dashboard/start_course_spec.rb
require 'rails_helper' RSpec.describe 'Starting Course from User Dashboard' do let!(:default_path) { create(:path, default_path: true) } let!(:foundations_course) { create(:course, title: 'Foundations', path: default_path) } let!(:user) { create(:user) } context 'when new user starts default path' do befo...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/user_dashboard/resume_course_spec.rb
spec/system/user_dashboard/resume_course_spec.rb
require 'rails_helper' RSpec.describe 'Resuming Course from User Dashboard' do let!(:default_path) { create(:path, default_path: true) } let!(:foundations_course) { create(:course, title: 'Foundations', path: default_path) } let!(:incomplete_lesson) { create(:lesson, course: foundations_course) } context 'whe...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/user_dashboard/open_course_spec.rb
spec/system/user_dashboard/open_course_spec.rb
require 'rails_helper' RSpec.describe 'Opening Course from User Dashboard' do let!(:default_path) { create(:path, default_path: true) } let!(:foundations_course) { create(:course, title: 'Foundations', path: default_path) } context 'when user has completed a course' do before do first_lesson = create(...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/lesson_project_submissions/flag_submission_spec.rb
spec/system/lesson_project_submissions/flag_submission_spec.rb
require 'rails_helper' RSpec.describe 'Flagging a Project Submission' do let(:user) { create(:user) } let(:lesson) { create(:lesson, :project) } let!(:project_submission) { create(:project_submission, lesson:) } before do sign_in(user) visit lesson_project_submissions_path(lesson) end it 'success...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/lesson_project_submissions/edit_submission_spec.rb
spec/system/lesson_project_submissions/edit_submission_spec.rb
require 'rails_helper' RSpec.describe 'Editing a Project Submission' do let(:user) { create(:user) } let(:lesson) { create(:lesson, :project) } let(:edited_field_values) do { repo_url: 'https://github.com/edited-project-repo-url', live_preview_url: 'http://edited-live-preview-url.com' } end...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/lesson_project_submissions/delete_submission_spec.rb
spec/system/lesson_project_submissions/delete_submission_spec.rb
require 'rails_helper' RSpec.describe 'Deleting a Project Submission' do let(:user) { create(:user) } let(:lesson) { create(:lesson, :project) } before do sign_in(user) visit lesson_path(lesson) Pages::ProjectSubmissions::Form.new.open.fill_in.submit end it 'removes a submission' do within(...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/lesson_project_submissions/like_spec.rb
spec/system/lesson_project_submissions/like_spec.rb
require 'rails_helper' RSpec.describe 'Liking project submissions' do let(:user) { create(:user) } let(:lesson) { create(:lesson, :project) } context 'when the submission has no likes' do before do create(:project_submission, lesson:) sign_in(user) create(:project_submission, user_id: use...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/lesson_project_submissions/add_submission_spec.rb
spec/system/lesson_project_submissions/add_submission_spec.rb
require 'rails_helper' RSpec.describe 'Add a Project Submission' do context 'when a user is signed in' do let(:lesson) { create(:lesson, :project) } let(:user) { create(:user) } let(:another_user) { create(:user) } before do sign_in(user) visit lesson_path(lesson) end it 'succes...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/user_project_submissions/edit_submission_spec.rb
spec/system/user_project_submissions/edit_submission_spec.rb
require 'rails_helper' RSpec.describe 'Editing a Project Submission on the Dashboard' do let(:user) { create(:user) } let(:another_user) { create(:user) } let(:lesson) { create(:lesson, :project) } let(:edited_field_values) do { repo_url: 'https://github.com/edited-project-repo-url', live_previ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/system/user_project_submissions/delete_submission_spec.rb
spec/system/user_project_submissions/delete_submission_spec.rb
require 'rails_helper' RSpec.describe 'Deleting a Project Submission on the Dashboard' do let(:user) { create(:user) } let(:lesson) { create(:lesson, :project) } before do create(:project_submission, user:, lesson:) sign_in(user) visit dashboard_path end it 'successfully deletes a submission' d...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/next_lesson_spec.rb
spec/services/next_lesson_spec.rb
require 'rails_helper' RSpec.describe NextLesson do subject(:next_lesson) { described_class.new(course, lesson_completions) } let(:course) { create(:course) } let!(:lesson_one) { create(:lesson, course:) } let!(:lesson_two) { create(:lesson, course:) } let!(:lesson_three) { create(:lesson, course:) } des...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/discord_notifier_spec.rb
spec/services/discord_notifier_spec.rb
require 'rails_helper' RSpec.describe DiscordNotifier do let(:notification) do instance_double(Notifications::DailySummary, message: 'A MESSAGE', destination: 'https://A-DESTINATION') end describe '#notify' do it 'sends the notification to discord' do VCR.use_cassette('discord_notification', recor...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/markdown_converter_spec.rb
spec/services/markdown_converter_spec.rb
require 'rails_helper' require './lib/kramdown/document_sections' RSpec.describe MarkdownConverter do describe '#as_html' do it 'converts the markdown to html with sections' do markdown = <<~MARKDOWN ### First section header some content ### Second section header some conte...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/course_progress_spec.rb
spec/services/course_progress_spec.rb
require 'rails_helper' class LessonCompletions def initialize(completed_lessons) @completed_lessons = completed_lessons end def where(lesson_id:) @completed_lessons.find_all { |lesson| lesson_id.include?(lesson) } end end RSpec.describe CourseProgress do subject(:course_progress) { described_class....
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/messages/dead_link_spec.rb
spec/services/messages/dead_link_spec.rb
require 'rails_helper' RSpec.describe Messages::DeadLink do subject(:message) { described_class.new(flag) } let(:flag) do create( :flag, created_at: Time.zone.local(2021, 8, 1), project_submission: create(:project_submission, lesson:, user:), reason: :inappropriate, extra: 'I fin...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/users/reset_progress_spec.rb
spec/services/users/reset_progress_spec.rb
require 'rails_helper' RSpec.describe Users::ResetProgress do subject(:service) { described_class.call(user) } let!(:user) { create(:user, path: foundations_path) } let!(:foundations_path) { create(:path, default_path: true) } before do create(:lesson_completion, lesson: create(:lesson), user:) creat...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/notifications/flag_submission_spec.rb
spec/services/notifications/flag_submission_spec.rb
require 'rails_helper' RSpec.describe Notifications::FlagSubmission do subject(:notification) { described_class.new(flag) } let(:flag) do create( :flag, id: 120, flagger:, project_submission: flagged_submission, reason: :inappropriate, extra: 'I find it offensive' ) e...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/notifications/daily_summary_spec.rb
spec/services/notifications/daily_summary_spec.rb
require 'rails_helper' RSpec.describe Notifications::DailySummary do subject(:notification) { described_class.new } describe '#message' do before do travel_to Time.utc(2020, 4, 10) end it 'returns the daily summary message' do expect(notification.message).to eql( "**TOP Summary Fo...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/services/courses/mark_completed_lessons_spec.rb
spec/services/courses/mark_completed_lessons_spec.rb
require 'rails_helper' RSpec.describe Courses::MarkCompletedLessons do describe '#call' do context 'when the lesson is included in users lesson completions' do it 'marks the lesson as completed' do user = create(:user) lesson = create(:lesson) create(:lesson_completion, lesson:, use...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/view_components.rb
spec/support/view_components.rb
require 'view_component/test_helpers' require 'capybara/rspec' RSpec.configure do |config| config.include ViewComponent::TestHelpers, type: :component config.include Capybara::RSpecMatchers, type: :component config.include Devise::Test::ControllerHelpers, type: :component config.before(:each, type: :component...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/capybara.rb
spec/support/capybara.rb
Capybara.default_max_wait_time = 5 Capybara.default_normalize_ws = true Capybara.save_path = File.expand_path(ENV.fetch('CAPYBARA_ARTIFACTS', './tmp/capybara')) Capybara.disable_animation = true Capybara.configure do |config| config.test_id = 'data-test' config.automatic_label_click = true config.server_port = 3...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/vcr.rb
spec/support/vcr.rb
VCR.configure do |vcr_config| vcr_config.cassette_library_dir = 'spec/vcr' vcr_config.filter_sensitive_data('<GITHUB_API_TOKEN>') do ENV['GITHUB_API_TOKEN'] end vcr_config.filter_sensitive_data('<GITHUB_APP_ID>') { ENV['GITHUB_APP_ID'] } vcr_config.filter_sensitive_data('<GITHUB_SECRET>') { ENV['GITHUB_...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/precompile_assets.rb
spec/support/precompile_assets.rb
RSpec.configure do |config| config.before(:suite) do examples = RSpec.world.filtered_examples.values.flatten has_no_system_tests = examples.none? { |example| example.metadata[:type] == :system } if ENV['CI'] $stdout.puts "\n🚀️️ CI detected. Skip assets compilation.\n" next end if h...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/devise.rb
spec/support/devise.rb
RSpec.configure do |config| config.include Devise::Test::ControllerHelpers, type: :controller config.include Devise::Test::IntegrationHelpers, type: :system config.include Devise::Test::IntegrationHelpers, type: :request config.include Warden::Test::Helpers end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/retry.rb
spec/support/retry.rb
require 'rspec/retry' if ENV['CI'].present? RSpec.configure do |config| config.verbose_retry = true config.display_try_failure_messages = true config.around :each, type: :system do |ex| ex.run_with_retry retry: 2 end end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/shoulda_matchers.rb
spec/support/shoulda_matchers.rb
RSpec.configure do |config| config.include(Shoulda::Matchers::ActiveModel, type: :model) config.include(Shoulda::Matchers::ActiveRecord, type: :model) end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/cuprite.rb
spec/support/cuprite.rb
require 'capybara/cuprite' module CupriteHelpers def pause page.driver.pause end def debug(*) page.driver.debug(*) end end Capybara.register_driver(:odin_cuprite) do |app| Capybara::Cuprite::Driver.new( app, window_size: [1200, 1200], browser_options: {}, flatten: false, process...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/email_helper.rb
spec/support/email_helper.rb
require 'capybara/email/rspec'
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/factory_bot.rb
spec/support/factory_bot.rb
RSpec.configure do |config| config.include FactoryBot::Syntax::Methods end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/time_helpers.rb
spec/support/time_helpers.rb
RSpec.configure do |config| config.include ActiveSupport::Testing::TimeHelpers end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/mail.rb
spec/support/mail.rb
RSpec.configure do |config| config.include Mail::Matchers end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/aasm.rb
spec/support/aasm.rb
require 'aasm/rspec'
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/devise_two_factor.rb
spec/support/devise_two_factor.rb
require 'devise_two_factor/spec_helpers' def otp_code_for(user) ROTP::TOTP.new(user.otp_secret).at(Time.zone.now) end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/oauth.rb
spec/support/oauth.rb
OmniAuth.config.test_mode = true def mock_oauth_provider(provider) OmniAuth.config.mock_auth[provider.to_sym] = OmniAuth::AuthHash.new( provider: provider.to_s, uid: '123', info: { email: 'odinstudent@example.com', name: 'chrissy shenko', image: 'http://github.com/fake-avatar' } )...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/pages/project_submissions/form.rb
spec/support/pages/project_submissions/form.rb
module Pages module ProjectSubmissions class Form extend Dry::Initializer include Capybara::DSL option :repo_url, default: -> { 'https://github.com/myname/my-project' } option :live_preview_url, default: -> { 'https://myprojectlivepreview.com' } option :previewable, default: -> { tr...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/shared_examples/shared_examples_for_authenticatable_with_two_factor.rb
spec/support/shared_examples/shared_examples_for_authenticatable_with_two_factor.rb
require 'rails_helper' RSpec.shared_examples 'authenticatable_with_two_factor' do |factory| let(:record) { create(factory, :pending) } describe '#generate_two_factor_secret_if_missing!' do context 'when the otp secret is not present' do it 'generates a new otp secret' do record.otp_secret = nil ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/support/shared_examples/shared_examples_for_likeable.rb
spec/support/shared_examples/shared_examples_for_likeable.rb
require 'rails_helper' RSpec.shared_examples 'likeable' do |factory| let(:record) { create(factory) } it { is_expected.to have_many(:likes).dependent(:destroy) } it { is_expected.to respond_to(:likes_count) } describe '#liked_by?' do context 'when the record is liked by the user' do it 'returns tru...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/adaptors/feature_spec.rb
spec/adaptors/feature_spec.rb
require 'rails_helper' RSpec.describe Feature do describe '.enabled?' do context 'when the feature is enabled' do it 'returns true' do actor = instance_double(User) allow(Flipper).to receive(:enabled?).with(:test_feature, actor).and_return(true) expect(described_class.enabled?(:tes...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/themes_spec.rb
spec/requests/themes_spec.rb
require 'rails_helper' RSpec.describe 'Themes' do describe 'PUT #update' do before do cookies[:theme] = 'light' end context 'when the theme is valid' do it 'switches themes' do expect do put themes_path(format: :turbo_stream, params: { theme: 'dark' }) end.to change...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/paths_spec.rb
spec/requests/paths_spec.rb
require 'rails_helper' RSpec.describe 'Paths' do describe 'GET #path' do context 'when path has more than one course' do it 'renders the path page' do path = create(:path) create(:course, path:) create(:course, path:) get path_url(path) expect(response).to have_htt...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/static_pages_spec.rb
spec/requests/static_pages_spec.rb
require 'rails_helper' RSpec.describe 'Static Pages' do describe 'GET #home' do it 'renders the home page' do get home_path expect(response).to have_http_status(:ok) end end describe 'GET #about' do it 'renders the about page' do get about_path expect(response).to have_http...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/errors_spec.rb
spec/requests/errors_spec.rb
require 'rails_helper' RSpec.describe 'Error Pages' do describe 'GET 404' do it 'returns the correct status code' do get '/404' expect(response).to have_http_status(:not_found) end it 'returns the correct page' do get '/404' expect(response.body).to include('Looks like you\'re lo...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/redirects_spec.rb
spec/requests/redirects_spec.rb
require 'rails_helper' RSpec.describe 'Redirects' do context 'when a request is made to web development 101 paths' do it 'redirects the old web development 101 course path to the foundations path' do get '/courses/web-development-101' expect(response).to redirect_to('/paths/foundations') end ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/lessons/previews_spec.rb
spec/requests/lessons/previews_spec.rb
require 'rails_helper' RSpec.describe 'Lesson preview' do describe 'GET #show' do it 'renders the preview input page' do get lessons_preview_path expect(response).to have_http_status(:success) end end describe 'POST #create' do it 'converts the markdown to html' do post lessons_pre...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/lessons/previews/share_spec.rb
spec/requests/lessons/previews/share_spec.rb
require 'rails_helper' RSpec.describe 'Share preview' do describe 'POST #create' do context 'when the preview is valid' do it 'creates a sharable preview' do expect do post lessons_preview_share_path(content: '# hello', format: :turbo_stream) end.to change { LessonPreview.count }....
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/invitations_spec.rb
spec/requests/admin/invitations_spec.rb
require 'rails_helper' RSpec.describe 'Admin invitations' do describe 'GET #new' do context 'when an admin is signed in' do it 'renders the new invitation page' do admin = create(:admin_user) sign_in(admin) get new_admin_user_invitation_path expect(response).to have_http_s...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/profile_spec.rb
spec/requests/admin/profile_spec.rb
require 'rails_helper' RSpec.describe 'Admin user profile' do describe 'GET #edit' do context 'when signed in as an admin' do it 'renders the edit profile page' do admin = create(:admin_user) sign_in(admin) get edit_admin_profile_path expect(response).to have_http_status(:...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/team_members_spec.rb
spec/requests/admin/team_members_spec.rb
require 'rails_helper' RSpec.describe 'Team members' do describe 'GET #index' do context 'when signed in as an admin' do it 'renders the team members page' do sign_in(create(:admin_user)) get admin_team_path expect(response).to have_http_status(:ok) end end context ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/learners_spec.rb
spec/requests/admin/learners_spec.rb
require 'rails_helper' RSpec.describe 'Learners' do describe 'GET #index' do context 'when signed in as an admin' do it 'renders the index page' do admin = create(:admin_user) sign_in(admin) get admin_learners_path expect(response).to have_http_status(:ok) end en...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/passwords_spec.rb
spec/requests/admin/passwords_spec.rb
require 'rails_helper' RSpec.describe 'Admin users passwords' do describe 'GET #new' do it 'redirects to the admin sign in page' do get new_admin_user_password_path expect(response).to redirect_to(new_admin_user_session_path) expect(flash[:alert]).to eq('Please sign in') end end descr...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/two_factor_authentication_spec.rb
spec/requests/admin/two_factor_authentication_spec.rb
require 'rails_helper' RSpec.describe 'Two factor authentication' do describe 'GET #new' do context 'when two factor authentication is already enabled' do it 'redirects to the dashboard' do admin = create(:admin_user, otp_required_for_login: true) sign_in(admin) get new_admin_two_f...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/reports/paths_spec.rb
spec/requests/admin/reports/paths_spec.rb
require 'rails_helper' RSpec.describe 'Reports - path' do describe 'GET #show' do context 'when signed in as an admin' do it 'renders the path report' do admin = create(:admin_user) path = create(:path) sign_in(admin) get admin_reports_path_path(path) expect(respon...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/reports/users_spec.rb
spec/requests/admin/reports/users_spec.rb
require 'rails_helper' RSpec.describe 'Reports - users' do describe 'GET #index' do context 'when signed in as an admin' do it 'renders the users report' do admin = create(:admin_user) sign_in(admin) get admin_reports_users_path expect(response).to have_http_status(:ok) ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/reports/lesson_completions_spec.rb
spec/requests/admin/reports/lesson_completions_spec.rb
require 'rails_helper' RSpec.describe 'Reports - lesson completions' do describe 'GET #show' do context 'when signed in as an admin' do it 'renders the lesson completions report' do admin = create(:admin_user) sign_in(admin) get admin_reports_lesson_completions_path expect...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/team_members/resend_invitation_spec.rb
spec/requests/admin/team_members/resend_invitation_spec.rb
require 'rails_helper' RSpec.describe 'Resend team member invite' do before do Mail::TestMailer.deliveries.clear end describe 'POST #create' do context 'when signed in as an admin and the team member is pending' do it 'sends another invitation email to the team member' do admin = create(:a...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/team_members/role_spec.rb
spec/requests/admin/team_members/role_spec.rb
require 'rails_helper' RSpec.describe 'Team member role' do describe 'GET #edit' do context 'when signed in as an admin and the team member exists' do it 'renders the edit template' do admin = create(:admin_user) team_member = create(:admin_user) sign_in(admin) get edit_ad...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/team_members/password_resets_spec.rb
spec/requests/admin/team_members/password_resets_spec.rb
require 'rails_helper' RSpec.describe 'Team member password resets' do before do Mail::TestMailer.deliveries.clear end describe 'POST #create' do context 'when signed in as an admin and the team member exists' do it 'sends a password reset email' do admin = create(:admin_user) othe...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/team_members/activities_spec.rb
spec/requests/admin/team_members/activities_spec.rb
require 'rails_helper' RSpec.describe 'Team member activities' do describe 'GET #index' do context 'when signed in as an admin' do it 'renders the team activities page' do admin = create(:admin_user) sign_in(admin) get admin_team_activities_path expect(response).to have_ht...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/team_members/reactivation_spec.rb
spec/requests/admin/team_members/reactivation_spec.rb
require 'rails_helper' RSpec.describe 'Team member reactivation' do describe 'PUT #update' do context 'when signed in as an admin and the team member exists' do before do Mail::TestMailer.deliveries.clear end it 'reactivates the team member' do admin = create(:admin_user) ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/team_members/two_factor_reset_spec.rb
spec/requests/admin/team_members/two_factor_reset_spec.rb
require 'rails_helper' RSpec.describe 'Team member two factor reset' do describe 'PUT #update' do context 'when signed in as an admin and the team member exists' do it 'resets the admins two factor credentials' do admin = create(:admin_user) other_admin = create(:admin_user, otp_secret: 'se...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/team_members/deactivation_spec.rb
spec/requests/admin/team_members/deactivation_spec.rb
require 'rails_helper' RSpec.describe 'Team member deactivation' do describe 'PUT #update' do context 'when signed in as an admin and the team member exists' do it 'deactivates the team member' do admin = create(:admin_user) active_admin = create(:admin_user, :activated) sign_in(ad...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/admin/profile/password_spec.rb
spec/requests/admin/profile/password_spec.rb
require 'rails_helper' RSpec.describe 'Admin user profile password' do describe 'PATCH #update' do context 'when signed in as an admin and the form is valid' do it "updates the admin user's password" do admin = create(:admin_user, password: 'oldpassword') sign_in(admin) expect do ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/api/points_spec.rb
spec/requests/api/points_spec.rb
require 'rails_helper' RSpec.describe 'Static Pages' do describe 'GET #index' do context 'when not authenticated' do it 'returns 401 forbidden' do get api_points_path expect(response).to have_http_status(:unauthorized) end end context 'when authenticated' do around do ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/users/registrations_spec.rb
spec/requests/users/registrations_spec.rb
require 'rails_helper' RSpec.describe 'User Registrations' do describe 'POST #create' do around do |example| perform_enqueued_jobs do example.run end end context 'when the user is valid' do it 'redirects to the dashboard' do post user_registration_path(params: { user: a...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/guides/installations_spec.rb
spec/requests/guides/installations_spec.rb
require 'rails_helper' RSpec.describe 'Installation Guides' do describe 'GET #index' do it 'renders the installation guides index' do get guides_installations_path expect(response).to have_http_status(:ok) end end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/requests/guides/community_spec.rb
spec/requests/guides/community_spec.rb
require 'rails_helper' RSpec.describe 'Community Guides' do describe 'GET #show' do it 'renders the community guides' do get guides_community_path expect(response).to have_http_status(:ok) end end describe 'GET #rules' do it 'renders the community rules guide' do get rules_guides_...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/helpers/button_helper_spec.rb
spec/helpers/button_helper_spec.rb
require 'rails_helper' RSpec.describe ButtonHelper do before do allow(helper).to receive(:resource_name).and_return('user') end describe '#sign_up_button' do it 'returns a sign up button' do expect(helper.sign_up_button).to eq('<a class="button button--primary" href="/sign_up">Sign up</a>') en...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/helpers/announcement_helper_spec.rb
spec/helpers/announcement_helper_spec.rb
require 'rails_helper' RSpec.describe AnnouncementHelper do describe '#disabled_announcement_ids' do let(:cookies) do { 'announcement_10' => 'disabled', 'announcement_20' => 'disabled', 'not_a_announcement_15' => 'disabled', 'announcement_' => 'disabled' } end ...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/helpers/qr_code_helper_spec.rb
spec/helpers/qr_code_helper_spec.rb
require 'rails_helper' RSpec.describe QrCodeHelper do describe '#qr_code_as_svg' do it 'returns an svg representation of a qr code' do expect(helper.qr_code_as_svg('https://www.theodinproject.com')) .to match_snapshot('qr_code_helper/qr_code_svg') end end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/helpers/lessons_helper_spec.rb
spec/helpers/lessons_helper_spec.rb
require 'rails_helper' RSpec.describe LessonsHelper do describe '#github_edit_url' do let(:lesson) { create(:lesson) } it 'returns the github edit url for the lesson' do expect(helper.github_edit_url(lesson)).to eql( 'https://github.com/TheOdinProject/curriculum/edit/main/lesson_course/lesson_...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
require 'rails_helper' RSpec.describe ApplicationHelper do describe 'title' do it 'sets the title' do helper.title('Courses') expect(helper.content_for(:title)).to eql('Courses | The Odin Project') end context 'when there is no input' do it 'returns nil' do expect(title).to be_...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/policies/admin_user_policy_spec.rb
spec/policies/admin_user_policy_spec.rb
require 'rails_helper' RSpec.describe AdminUserPolicy do describe '#change_role?' do subject(:policy) { described_class.new(admin_user).change_role? } context 'when the admin user has the core role' do let(:admin_user) { create(:admin_user, role: 'core') } it { is_expected.to be(true) } end...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/policies/submission_like_policy_spec.rb
spec/policies/submission_like_policy_spec.rb
require 'rails_helper' RSpec.describe SubmissionLikePolicy do describe '#allowed?' do context 'when there are recent accounts with the same ip' do it 'cannot like the project submission' do user = create(:user, current_sign_in_ip: '127.0.0.1') create(:user, last_sign_in_ip: user.current_sig...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/factories/lessons.rb
spec/factories/lessons.rb
FactoryBot.define do factory :lesson do section sequence(:title) { |n| "test lesson#{n}" } sequence(:position) { |n| n } github_path { '/lesson_course/lesson_title.md' } identifier_uuid { SecureRandom.uuid } trait :project do is_project { true } accepts_submission { true } p...
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/factories/users.rb
spec/factories/users.rb
FactoryBot.define do factory :user do sequence(:username) { |n| "foobar#{n}" } sequence(:email) { |n| "foo#{n}@bar.com" } password { 'foobar' } avatar { 'http://github.com/fake-avatar' } path end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/factories/sections.rb
spec/factories/sections.rb
FactoryBot.define do factory :section do course sequence(:title) { |n| "test section#{n}" } sequence(:position) { |n| n } identifier_uuid { SecureRandom.uuid } end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/factories/likes.rb
spec/factories/likes.rb
FactoryBot.define do factory :like do user likeable factory: :project_submission end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/factories/contents.rb
spec/factories/contents.rb
FactoryBot.define do factory :content do lesson body { 'content' } end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/factories/flags.rb
spec/factories/flags.rb
FactoryBot.define do factory :flag do flagger { association :user } project_submission reason { :spam } extra { "It's offensive" } trait :active do status { :active } end trait :resolved do status { :resolved } resolved_by { association :admin_user } end end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false
TheOdinProject/theodinproject
https://github.com/TheOdinProject/theodinproject/blob/bc97027b6e48d5197a4e88f4b05b9c4341c19b3a/spec/factories/interview_concepts.rb
spec/factories/interview_concepts.rb
FactoryBot.define do factory :interview_concept do name { 'React' } end end
ruby
MIT
bc97027b6e48d5197a4e88f4b05b9c4341c19b3a
2026-01-04T15:46:55.521218Z
false