Skip to content

Instantly share code, notes, and snippets.

@mycargus
Created January 18, 2016 20:53
Show Gist options
  • Select an option

  • Save mycargus/61c6e1ac6bb6a8b1dab1 to your computer and use it in GitHub Desktop.

Select an option

Save mycargus/61c6e1ac6bb6a8b1dab1 to your computer and use it in GitHub Desktop.
Selective Release (AKA Differentiated Assignments) example specs
require_relative '../../helpers/selective_release/selective_release_common'
describe 'Viewing selective release assignments' do
include_context 'selective release'
let(:assignments) { SelectiveRelease::Homework::Assignments }
let(:discussions) { SelectiveRelease::Homework::Discussions }
let(:quizzes) { SelectiveRelease::Homework::Quizzes }
context 'as the teacher' do
before(:each) { login_as(SelectiveRelease::Users.teacher) }
context 'on the assignments index page' do
before(:each) { go_to(SelectiveRelease::URLs.assignments_index_page) }
it 'shows all quizzes, assignments, and discussions' do
expect(list_of_assignments.text).to include(
*assignments.all.map(&:title),
*discussions.all.map(&:title),
*quizzes.all.map(&:title)
)
end
end
end
context 'as the first student' do
before(:each) { login_as(SelectiveRelease::Users.first_student) }
context 'on the assignments index page' do
before(:each) { go_to(SelectiveRelease::URLs.assignments_index_page) }
it 'only shows assigned quizzes, assignments, and discussions' do
expect(list_of_assignments.text).to include(
# assignments
assignments.assignment_for_everyone.title,
assignments.assignment_for_section_a.title,
assignments.assignment_for_sections_a_and_b.title,
assignments.assignment_for_first_student.title,
# discussions
discussions.discussion_for_everyone.title,
# ...
# quizzes
# ...
quizzes.quiz_for_everyone.title
)
end
it 'hides other quizzes, assignments and discussions' do
expect(list_of_assignments.text).to include(
# ...
)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment