spec/course_spec.rb in lessonly-ruby-0.0.1 vs spec/course_spec.rb in lessonly-ruby-0.1.0
- old
+ new
@@ -1,34 +1,34 @@
require 'spec_helper'
describe Lessonly::Course do
- context '#all' do
+ describe '#all' do
it 'should return all courses' do
courses = Lessonly::Course.all
expect(courses.count).to eq 3
expect(courses.first.title).to eq 'HIPAA Basic'
expect(courses.first.id).to eq 1
end
end
- context '#find' do
+ describe '#find' do
it 'should find a single course' do
course = Lessonly::Course.find(1)
expect(course.title).to eq 'HIPAA Advanced'
end
end
- context '#lessons' do
+ describe '#lessons' do
it 'should have many lessons' do
course = Lessonly::Course.find(1)
expect(course.lessons.first).to be_a Lessonly::Lesson
expect(course.lessons.first.title).to eq 'Basic HIPAA Lesson'
end
end
- context '#assignments' do
+ describe '#assignments' do
it 'should have many assignments' do
course = Lessonly::Course.find(1)
assignments = course.assignments
expect(assignments.count).to eq 1
@@ -41,11 +41,11 @@
expect(assignee).to be_a Lessonly::User
expect(assignee.name).to eq 'Chas Ballew'
end
end
- context '#create_assignment' do
+ describe '#create_assignment' do
it 'should create a user assignment' do
course = Lessonly::Course.find(1)
user = Lessonly::User.find(3)
course.create_assignment(user)
@@ -53,10 +53,10 @@
expect(course.assignments.map(&:assignee_id)).to include(user.id)
expect(course.assignments.count).to eq 2
end
end
- context '#destroy_assignment' do
+ describe '#destroy_assignment' do
it 'should remove a user assignment' do
course = Lessonly::Course.find(1)
user = Lessonly::User.find(1)
course.destroy_assignment(user)