spec: replace it_should_behave_like with include_examples
Change-Id: I8a10679218b9a6ff8485b7822a21c704bdfaa398 Reviewed-on: https://gerrit.instructure.com/29213 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Cody Cutrer <cody@instructure.com> Product-Review: James Williams <jamesw@instructure.com> QA-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
parent
19f81e6cc9
commit
d9ae1efd2c
|
@ -254,7 +254,7 @@ shared_examples_for "file uploads api" do
|
|||
end
|
||||
|
||||
shared_examples_for "file uploads api with folders" do
|
||||
it_should_behave_like "file uploads api"
|
||||
include_examples "file uploads api"
|
||||
|
||||
it "should allow specifying a folder with deprecated argument name" do
|
||||
preflight({ :name => "with_path.txt", :folder => "files/a/b/c/mypath" })
|
||||
|
|
|
@ -35,7 +35,7 @@ describe AssignmentsApiController, type: :request do
|
|||
api_get_assignment_in_course(locked_item, @course)
|
||||
end
|
||||
|
||||
it_should_behave_like 'a locked api item'
|
||||
include_examples 'a locked api item'
|
||||
end
|
||||
|
||||
def create_submitted_assignment_with_user(user=@user)
|
||||
|
|
|
@ -33,7 +33,7 @@ describe "AuthenticationAudit API", type: :request do
|
|||
end
|
||||
|
||||
context "configured" do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
before do
|
||||
Setting.set('enable_page_views', 'cassandra')
|
||||
|
|
|
@ -197,7 +197,7 @@ describe "Collections API", type: :request do
|
|||
end
|
||||
|
||||
context "a user's own collections" do
|
||||
it_should_behave_like "full access to collections"
|
||||
include_examples "full access to collections"
|
||||
|
||||
it "should create a default private collection if no collections exist for the context" do
|
||||
@empty_user = user_with_pseudonym
|
||||
|
@ -210,7 +210,7 @@ describe "Collections API", type: :request do
|
|||
end
|
||||
|
||||
context "another user's collections" do
|
||||
it_should_behave_like "public only access to collections"
|
||||
include_examples "public only access to collections"
|
||||
end
|
||||
|
||||
it "should not allow following your own collection" do
|
||||
|
@ -489,7 +489,7 @@ describe "Collections API", type: :request do
|
|||
@group_membership = @group.add_user(@user, 'accepted', true)
|
||||
end
|
||||
|
||||
it_should_behave_like "full access to collections"
|
||||
include_examples "full access to collections"
|
||||
end
|
||||
|
||||
context "a group's collections, as member" do
|
||||
|
@ -540,7 +540,7 @@ describe "Collections API", type: :request do
|
|||
end
|
||||
|
||||
context "a group's collections, as a non-member" do
|
||||
it_should_behave_like "public only access to collections"
|
||||
include_examples "public only access to collections"
|
||||
end
|
||||
|
||||
describe "following" do
|
||||
|
|
|
@ -33,7 +33,7 @@ describe "CourseAudit API", type: :integration do
|
|||
end
|
||||
|
||||
context "configured" do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
before do
|
||||
@request_id = UUIDSingleton.instance.generate
|
||||
|
|
|
@ -1718,8 +1718,8 @@ describe CoursesController, type: :request do
|
|||
|
||||
|
||||
context "course files" do
|
||||
it_should_behave_like "file uploads api with folders"
|
||||
it_should_behave_like "file uploads api with quotas"
|
||||
include_examples "file uploads api with folders"
|
||||
include_examples "file uploads api with quotas"
|
||||
|
||||
before :each do
|
||||
@context = @course
|
||||
|
|
|
@ -90,7 +90,7 @@ describe DiscussionTopicsController, type: :request do
|
|||
)
|
||||
end
|
||||
|
||||
it_should_behave_like 'a locked api item'
|
||||
include_examples 'a locked api item'
|
||||
end
|
||||
|
||||
before(:each) do
|
||||
|
|
|
@ -101,7 +101,7 @@ describe 'ExternalFeedsController', type: :request do
|
|||
end
|
||||
|
||||
describe "in a Course" do
|
||||
it_should_behave_like "Announcement External Feeds"
|
||||
include_examples "Announcement External Feeds"
|
||||
before do
|
||||
@allowed_user = teacher_in_course(:active_all => true).user
|
||||
@context = @course
|
||||
|
@ -112,7 +112,7 @@ describe 'ExternalFeedsController', type: :request do
|
|||
end
|
||||
|
||||
describe "in a Group" do
|
||||
it_should_behave_like "Announcement External Feeds"
|
||||
include_examples "Announcement External Feeds"
|
||||
before do
|
||||
group_with_user(:moderator => true, :active_all => true)
|
||||
@allowed_user = @user
|
||||
|
|
|
@ -36,7 +36,7 @@ describe "Files API", type: :request do
|
|||
)
|
||||
end
|
||||
|
||||
it_should_behave_like 'a locked api item'
|
||||
include_examples 'a locked api item'
|
||||
end
|
||||
|
||||
before do
|
||||
|
|
|
@ -34,7 +34,7 @@ describe "GradeChangeAudit API", type: :request do
|
|||
end
|
||||
|
||||
context "configured" do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
before do
|
||||
@request_id = UUIDSingleton.instance.generate
|
||||
|
|
|
@ -694,8 +694,8 @@ describe "Groups API", type: :request do
|
|||
end
|
||||
|
||||
context "group files" do
|
||||
it_should_behave_like "file uploads api with folders"
|
||||
it_should_behave_like "file uploads api with quotas"
|
||||
include_examples "file uploads api with folders"
|
||||
include_examples "file uploads api with quotas"
|
||||
|
||||
before do
|
||||
@user = @member
|
||||
|
|
|
@ -46,7 +46,7 @@ describe "Pages API", type: :request do
|
|||
)
|
||||
end
|
||||
|
||||
it_should_behave_like 'a locked api item'
|
||||
include_examples 'a locked api item'
|
||||
end
|
||||
|
||||
before do
|
||||
|
|
|
@ -31,7 +31,7 @@ describe QuizSubmissionFilesController, type: :request do
|
|||
s = @quiz.generate_submission(@student)
|
||||
end
|
||||
|
||||
it_should_behave_like "file uploads api"
|
||||
include_examples "file uploads api"
|
||||
|
||||
def preflight(preflight_params)
|
||||
json = api_call :post,
|
||||
|
|
|
@ -314,7 +314,7 @@ describe QuizSubmissionsApiController, type: :request do
|
|||
end
|
||||
|
||||
context 'access validations' do
|
||||
it_should_behave_like 'Quiz Submissions API Restricted Endpoints'
|
||||
include_examples 'Quiz Submissions API Restricted Endpoints'
|
||||
|
||||
before :each do
|
||||
@request_proxy = method(:qs_api_create)
|
||||
|
@ -341,7 +341,7 @@ describe QuizSubmissionsApiController, type: :request do
|
|||
end
|
||||
|
||||
context 'access validations' do
|
||||
it_should_behave_like 'Quiz Submissions API Restricted Endpoints'
|
||||
include_examples 'Quiz Submissions API Restricted Endpoints'
|
||||
|
||||
before do
|
||||
@request_proxy = method(:qs_api_complete)
|
||||
|
|
|
@ -36,7 +36,7 @@ describe QuizzesApiController, type: :request do
|
|||
)
|
||||
end
|
||||
|
||||
it_should_behave_like 'a locked api item'
|
||||
include_examples 'a locked api item'
|
||||
end
|
||||
|
||||
describe "GET /courses/:course_id/quizzes (index)" do
|
||||
|
|
|
@ -30,7 +30,7 @@ describe 'Submissions Comment API', type: :request do
|
|||
submission_types: "online_upload"
|
||||
end
|
||||
|
||||
it_should_behave_like "file uploads api"
|
||||
include_examples "file uploads api"
|
||||
def has_query_exemption?; false; end
|
||||
def preflight(preflight_params)
|
||||
api_call :post,
|
||||
|
|
|
@ -2060,8 +2060,8 @@ describe 'Submissions API', type: :request do
|
|||
@always_scribd = true
|
||||
end
|
||||
|
||||
it_should_behave_like "file uploads api"
|
||||
it_should_behave_like "file uploads api without quotas"
|
||||
include_examples "file uploads api"
|
||||
include_examples "file uploads api without quotas"
|
||||
|
||||
def preflight(preflight_params)
|
||||
api_call(:post, "/api/v1/courses/#{@course.id}/assignments/#{@assignment.id}/submissions/#{@student1.id}/files",
|
||||
|
|
|
@ -274,11 +274,11 @@ describe "Users API", type: :request do
|
|||
end
|
||||
end
|
||||
|
||||
it_should_behave_like "page view api"
|
||||
include_examples "page view api"
|
||||
|
||||
describe "cassandra page views" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
it_should_behave_like "page view api"
|
||||
include_examples "cassandra page views"
|
||||
include_examples "page view api"
|
||||
end
|
||||
|
||||
it "shouldn't find users in other root accounts by sis id" do
|
||||
|
@ -763,8 +763,8 @@ describe "Users API", type: :request do
|
|||
@context = @user
|
||||
end
|
||||
|
||||
it_should_behave_like "file uploads api with folders"
|
||||
it_should_behave_like "file uploads api with quotas"
|
||||
include_examples "file uploads api with folders"
|
||||
include_examples "file uploads api with quotas"
|
||||
|
||||
def preflight(preflight_params)
|
||||
api_call(:post, "/api/v1/users/self/files",
|
||||
|
|
|
@ -66,11 +66,11 @@ describe PageViewsController do
|
|||
before :each do
|
||||
Setting.set('enable_page_views', true)
|
||||
end
|
||||
it_should_behave_like "GET 'index' as csv"
|
||||
include_examples "GET 'index' as csv"
|
||||
end
|
||||
|
||||
context "with cassandra page views" do
|
||||
it_should_behave_like 'cassandra page views'
|
||||
it_should_behave_like "GET 'index' as csv"
|
||||
include_examples 'cassandra page views'
|
||||
include_examples "GET 'index' as csv"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../sharding_spec_helper.r
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../../cassandra_spec_helper')
|
||||
|
||||
describe AuthenticationAuditApiController do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
before do
|
||||
RequestContextGenerator.stubs( :request_id => 'xyz' )
|
||||
|
|
|
@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../sharding_spec_helper.r
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../../cassandra_spec_helper')
|
||||
|
||||
describe CourseAuditApiController do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
before do
|
||||
RequestContextGenerator.stubs( :request_id => 'xyz' )
|
||||
|
|
|
@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../sharding_spec_helper.r
|
|||
require File.expand_path(File.dirname(__FILE__) + '/../../cassandra_spec_helper')
|
||||
|
||||
describe GradeChangeAuditApiController do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
before do
|
||||
RequestContextGenerator.stubs( :request_id => 'xyz' )
|
||||
|
|
|
@ -78,7 +78,7 @@ describe Canvas::ICU do
|
|||
end
|
||||
|
||||
context "NaiveCollator" do
|
||||
it_should_behave_like "Collator"
|
||||
include_examples "Collator"
|
||||
|
||||
before do
|
||||
Canvas::ICU.stubs(:collator).returns(Canvas::ICU::NaiveCollator)
|
||||
|
@ -86,7 +86,7 @@ describe Canvas::ICU do
|
|||
end
|
||||
|
||||
context "ICU" do
|
||||
it_should_behave_like "Collator"
|
||||
include_examples "Collator"
|
||||
|
||||
before do
|
||||
pending if Canvas::ICU.collator == Canvas::ICU::NaiveCollator
|
||||
|
|
|
@ -453,14 +453,14 @@ shared_examples_for "an object whose dates are overridable" do
|
|||
end
|
||||
|
||||
describe Assignment do
|
||||
it_should_behave_like "an object whose dates are overridable"
|
||||
include_examples "an object whose dates are overridable"
|
||||
|
||||
let(:overridable) { assignment_model(:due_at => 5.days.ago) }
|
||||
let(:overridable_type) { :assignment }
|
||||
end
|
||||
|
||||
describe Quizzes::Quiz do
|
||||
it_should_behave_like "an object whose dates are overridable"
|
||||
include_examples "an object whose dates are overridable"
|
||||
|
||||
let(:overridable) { quiz_model(:due_at => 5.days.ago) }
|
||||
let(:overridable_type) { :quiz }
|
||||
|
|
|
@ -406,7 +406,7 @@ describe EventStream do
|
|||
@database.stubs(:batch).raises(@exception)
|
||||
end
|
||||
|
||||
it_should_behave_like "recording failures"
|
||||
include_examples "recording failures"
|
||||
end
|
||||
|
||||
context "failing callbacks" do
|
||||
|
@ -430,7 +430,7 @@ describe EventStream do
|
|||
@stream.update(@record)
|
||||
end
|
||||
|
||||
it_should_behave_like "recording failures"
|
||||
include_examples "recording failures"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ require File.expand_path '../../../mocha_rspec_adapter', __FILE__
|
|||
require File.expand_path '../mailbox_spec_helper', __FILE__
|
||||
|
||||
describe IncomingMail::DirectoryMailbox do
|
||||
it_should_behave_like 'Mailbox'
|
||||
include_examples 'Mailbox'
|
||||
|
||||
def default_config
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ require File.expand_path('../../../mocha_rspec_adapter', __FILE__)
|
|||
require File.expand_path('../mailbox_spec_helper', __FILE__)
|
||||
|
||||
describe IncomingMail::ImapMailbox do
|
||||
it_should_behave_like 'Mailbox'
|
||||
include_examples 'Mailbox'
|
||||
|
||||
def default_config
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ require File.expand_path '../../../mocha_rspec_adapter', __FILE__
|
|||
require File.expand_path '../mailbox_spec_helper', __FILE__
|
||||
|
||||
describe IncomingMail::Pop3Mailbox do
|
||||
it_should_behave_like 'Mailbox'
|
||||
include_examples 'Mailbox'
|
||||
|
||||
def default_config
|
||||
{
|
||||
|
|
|
@ -38,10 +38,10 @@ describe Reporting::CountsReport do
|
|||
|
||||
context "sharding" do
|
||||
specs_require_sharding
|
||||
it_should_behave_like "counts_report"
|
||||
include_examples "counts_report"
|
||||
end
|
||||
|
||||
it_should_behave_like "counts_report"
|
||||
include_examples "counts_report"
|
||||
|
||||
describe "detailed report" do
|
||||
describe "courses" do
|
||||
|
@ -108,7 +108,7 @@ describe Reporting::CountsReport do
|
|||
end
|
||||
|
||||
let(:datum) { 'teachers' }
|
||||
it_should_behave_like "user_counts"
|
||||
include_examples "user_counts"
|
||||
end
|
||||
|
||||
describe "students" do
|
||||
|
@ -119,7 +119,7 @@ describe Reporting::CountsReport do
|
|||
end
|
||||
|
||||
let(:datum) { 'students' }
|
||||
it_should_behave_like "user_counts"
|
||||
include_examples "user_counts"
|
||||
end
|
||||
|
||||
describe "users" do
|
||||
|
@ -130,7 +130,7 @@ describe Reporting::CountsReport do
|
|||
end
|
||||
|
||||
let(:datum) { 'users' }
|
||||
it_should_behave_like "user_counts"
|
||||
include_examples "user_counts"
|
||||
|
||||
it "should include tas" do
|
||||
Reporting::CountsReport.process
|
||||
|
|
|
@ -32,12 +32,12 @@ describe 'DataFixup::FilterPageViewUrlParams' do
|
|||
end
|
||||
|
||||
describe "db" do
|
||||
it_should_behave_like 'DataFixup::FilterPageViewUrlParams'
|
||||
include_examples 'DataFixup::FilterPageViewUrlParams'
|
||||
end
|
||||
|
||||
describe "cassandra" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
it_should_behave_like 'DataFixup::FilterPageViewUrlParams'
|
||||
include_examples "cassandra page views"
|
||||
include_examples 'DataFixup::FilterPageViewUrlParams'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ describe AccountUser do
|
|||
end
|
||||
|
||||
context "non-sharded" do
|
||||
it_should_behave_like "touching"
|
||||
include_examples "touching"
|
||||
|
||||
before do
|
||||
@account = Account.default
|
||||
|
@ -60,7 +60,7 @@ describe AccountUser do
|
|||
|
||||
context "sharding" do
|
||||
specs_require_sharding
|
||||
it_should_behave_like "touching"
|
||||
include_examples "touching"
|
||||
|
||||
before do
|
||||
@account = @shard1.activate { Account.create! }
|
||||
|
|
|
@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
|
|||
require_relative('web_conference_spec_helper')
|
||||
|
||||
describe BigBlueButtonConference do
|
||||
it_should_behave_like 'WebConference'
|
||||
include_examples 'WebConference'
|
||||
|
||||
context "big_blue_button" do
|
||||
before do
|
||||
|
|
|
@ -100,7 +100,7 @@ describe 'Collections' do
|
|||
end
|
||||
|
||||
describe "user collections" do
|
||||
it_should_behave_like "auto-follow context"
|
||||
include_examples "auto-follow context"
|
||||
before do
|
||||
@context = user_model
|
||||
@user = user_model
|
||||
|
@ -109,7 +109,7 @@ describe 'Collections' do
|
|||
end
|
||||
|
||||
describe "group collections as non-member" do
|
||||
it_should_behave_like "auto-follow context"
|
||||
include_examples "auto-follow context"
|
||||
before do
|
||||
@context = group_model
|
||||
@user = user_model
|
||||
|
@ -118,7 +118,7 @@ describe 'Collections' do
|
|||
end
|
||||
|
||||
describe "group collections as member" do
|
||||
it_should_behave_like "auto-follow context"
|
||||
include_examples "auto-follow context"
|
||||
before do
|
||||
group_with_user
|
||||
@context = @group
|
||||
|
|
|
@ -363,7 +363,7 @@ describe ContentTag do
|
|||
att.display_name.should == 'important title.txt'
|
||||
end
|
||||
|
||||
it_should_behave_like "url validation tests"
|
||||
include_examples "url validation tests"
|
||||
it "should check url validity" do
|
||||
quiz = course.quizzes.create!
|
||||
test_url_validation(ContentTag.create!(:content => quiz, :context => @course))
|
||||
|
|
|
@ -231,11 +231,11 @@ describe Conversation do
|
|||
end
|
||||
end
|
||||
|
||||
it_should_behave_like "message counts"
|
||||
include_examples "message counts"
|
||||
|
||||
context "sharding" do
|
||||
specs_require_sharding
|
||||
it_should_behave_like "message counts"
|
||||
include_examples "message counts"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -318,10 +318,10 @@ describe Conversation do
|
|||
end
|
||||
end
|
||||
|
||||
it_should_behave_like "unread counts"
|
||||
include_examples "unread counts"
|
||||
context "sharding" do
|
||||
specs_require_sharding
|
||||
it_should_behave_like "unread counts"
|
||||
include_examples "unread counts"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ describe PageView do
|
|||
end
|
||||
|
||||
describe "cassandra page views" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
include_examples "cassandra page views"
|
||||
it "should store and load from cassandra" do
|
||||
expect {
|
||||
@page_view.save!
|
||||
|
@ -319,7 +319,7 @@ describe PageView do
|
|||
end
|
||||
|
||||
context "cassandra-backed" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
include_examples "cassandra page views"
|
||||
|
||||
it "should return the existing page view" do
|
||||
page_views = (0..3).map { |index| page_view_model }
|
||||
|
@ -354,7 +354,7 @@ describe PageView do
|
|||
end
|
||||
|
||||
context "cassandra-backed" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
include_examples "cassandra page views"
|
||||
|
||||
it "should return the existing page view" do
|
||||
page_views = (0..3).map { |index| page_view_model }
|
||||
|
@ -387,7 +387,7 @@ describe PageView do
|
|||
end
|
||||
|
||||
context "cassandra-backed" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
include_examples "cassandra page views"
|
||||
|
||||
it "should return the existing page view" do
|
||||
pv = page_view_model
|
||||
|
@ -417,7 +417,7 @@ describe PageView do
|
|||
end
|
||||
|
||||
context "cassandra-backed" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
include_examples "cassandra page views"
|
||||
|
||||
it "should return the existing page view" do
|
||||
pv = page_view_model
|
||||
|
@ -447,7 +447,7 @@ describe PageView do
|
|||
end
|
||||
|
||||
context "cassandra-backed" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
include_examples "cassandra page views"
|
||||
|
||||
it "should return the existing page view" do
|
||||
pv = page_view_model
|
||||
|
@ -499,7 +499,7 @@ describe PageView do
|
|||
end
|
||||
|
||||
context "cassandra-backed" do
|
||||
it_should_behave_like "cassandra page views"
|
||||
include_examples "cassandra page views"
|
||||
|
||||
it "should interpret ids relative to the default shard" do
|
||||
user_id = 1
|
||||
|
|
|
@ -47,6 +47,6 @@ describe QuizQuestion::AnswerParsers::FillInMultipleBlanks do
|
|||
let(:question_params) { Hash.new }
|
||||
let(:parser_class) { QuizQuestion::AnswerParsers::FillInMultipleBlanks }
|
||||
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -59,7 +59,7 @@ describe QuizQuestion::AnswerParsers::Matching do
|
|||
|
||||
let(:parser_class) { QuizQuestion::AnswerParsers::Matching }
|
||||
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -49,7 +49,7 @@ describe QuizQuestion::AnswerParsers::MissingWord do
|
|||
let(:parser_class) { QuizQuestion::AnswerParsers::MissingWord }
|
||||
|
||||
context "in general" do
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
end
|
||||
|
||||
context "with no answer specified as correct" do
|
||||
|
|
|
@ -48,7 +48,7 @@ describe QuizQuestion::AnswerParsers::MultipleAnswers do
|
|||
let(:question_params) { Hash.new }
|
||||
|
||||
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ describe QuizQuestion::AnswerParsers::MultipleChoice do
|
|||
let(:question_params) { Hash.new }
|
||||
let(:parser_class) { QuizQuestion::AnswerParsers::MultipleChoice }
|
||||
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -50,7 +50,7 @@ describe QuizQuestion::AnswerParsers::MultipleDropdowns do
|
|||
let(:question_params) { Hash.new }
|
||||
let(:parser_class) { QuizQuestion::AnswerParsers::MultipleDropdowns }
|
||||
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -47,6 +47,6 @@ describe QuizQuestion::AnswerParsers::Numerical do
|
|||
let(:question_params) { Hash.new }
|
||||
let(:parser_class) { QuizQuestion::AnswerParsers::Numerical }
|
||||
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -47,7 +47,7 @@ describe QuizQuestion::AnswerParsers::ShortAnswer do
|
|||
let(:question_params) { Hash.new }
|
||||
let(:parser_class) { QuizQuestion::AnswerParsers::ShortAnswer }
|
||||
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -47,7 +47,7 @@ describe QuizQuestion::AnswerParsers::TrueFalse do
|
|||
let(:question_params) { Hash.new }
|
||||
let(:parser_class) { QuizQuestion::AnswerParsers::TrueFalse }
|
||||
|
||||
it_should_behave_like "All answer parsers"
|
||||
include_examples "All answer parsers"
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/support/answer_serializers_s
|
|||
require File.expand_path(File.dirname(__FILE__) + '/support/textual_answer_serializers_specs.rb')
|
||||
|
||||
describe QuizQuestion::AnswerSerializers::Essay do
|
||||
it_should_behave_like 'Answer Serializers'
|
||||
include_examples 'Answer Serializers'
|
||||
|
||||
let :input do
|
||||
'Hello World!'
|
||||
|
@ -20,6 +20,6 @@ describe QuizQuestion::AnswerSerializers::Essay do
|
|||
end
|
||||
|
||||
context 'validations' do
|
||||
it_should_behave_like 'Textual Answer Serializers'
|
||||
include_examples 'Textual Answer Serializers'
|
||||
end
|
||||
end
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/support/answer_serializers_s
|
|||
require File.expand_path(File.dirname(__FILE__) + '/support/textual_answer_serializers_specs.rb')
|
||||
|
||||
describe QuizQuestion::AnswerSerializers::FillInMultipleBlanks do
|
||||
it_should_behave_like 'Answer Serializers'
|
||||
include_examples 'Answer Serializers'
|
||||
|
||||
let :input do
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ describe QuizQuestion::AnswerSerializers::FillInMultipleBlanks do
|
|||
end
|
||||
|
||||
context 'validations' do
|
||||
it_should_behave_like 'Textual Answer Serializers'
|
||||
include_examples 'Textual Answer Serializers'
|
||||
|
||||
it 'should reject unexpected types' do
|
||||
[ 'asdf', nil ].each do |bad_input|
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/support/answer_serializers_specs.rb')
|
||||
|
||||
describe QuizQuestion::AnswerSerializers::Matching do
|
||||
it_should_behave_like 'Answer Serializers'
|
||||
include_examples 'Answer Serializers'
|
||||
|
||||
let :input do
|
||||
[
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/support/answer_serializers_s
|
|||
require File.expand_path(File.dirname(__FILE__) + '/support/id_answer_serializers_specs.rb')
|
||||
|
||||
describe QuizQuestion::AnswerSerializers::MultipleAnswers do
|
||||
it_should_behave_like 'Answer Serializers'
|
||||
include_examples 'Answer Serializers'
|
||||
|
||||
let :factory_options do
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ describe QuizQuestion::AnswerSerializers::MultipleAnswers do
|
|||
end
|
||||
|
||||
context 'validations' do
|
||||
it_should_behave_like 'Id Answer Serializers'
|
||||
include_examples 'Id Answer Serializers'
|
||||
|
||||
it 'should reject unexpected types' do
|
||||
[ nil, 'asdf' ].each do |bad_input|
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/support/answer_serializers_s
|
|||
require File.expand_path(File.dirname(__FILE__) + '/support/id_answer_serializers_specs.rb')
|
||||
|
||||
describe QuizQuestion::AnswerSerializers::MultipleChoice do
|
||||
it_should_behave_like 'Answer Serializers'
|
||||
include_examples 'Answer Serializers'
|
||||
|
||||
let :input do
|
||||
2405
|
||||
|
@ -16,6 +16,6 @@ describe QuizQuestion::AnswerSerializers::MultipleChoice do
|
|||
end
|
||||
|
||||
context 'validations' do
|
||||
it_should_behave_like 'Id Answer Serializers'
|
||||
include_examples 'Id Answer Serializers'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/support/answer_serializers_s
|
|||
require File.expand_path(File.dirname(__FILE__) + '/support/id_answer_serializers_specs.rb')
|
||||
|
||||
describe QuizQuestion::AnswerSerializers::MultipleDropdowns do
|
||||
it_should_behave_like 'Answer Serializers'
|
||||
include_examples 'Answer Serializers'
|
||||
|
||||
let :input do
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ describe QuizQuestion::AnswerSerializers::MultipleDropdowns do
|
|||
end
|
||||
|
||||
context 'validations' do
|
||||
it_should_behave_like 'Id Answer Serializers'
|
||||
include_examples 'Id Answer Serializers'
|
||||
|
||||
it 'should reject an answer for an unknown blank' do
|
||||
rc = subject.serialize({ foobar: 123456 })
|
||||
|
|
|
@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb')
|
|||
require File.expand_path(File.dirname(__FILE__) + '/support/answer_serializers_specs.rb')
|
||||
|
||||
describe QuizQuestion::AnswerSerializers::Numerical do
|
||||
it_should_behave_like 'Answer Serializers'
|
||||
include_examples 'Answer Serializers'
|
||||
|
||||
let :inputs do
|
||||
[ 25.3, 25e-6, '0.12', '3' ]
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/support/answer_serializers_s
|
|||
require File.expand_path(File.dirname(__FILE__) + '/support/textual_answer_serializers_specs.rb')
|
||||
|
||||
describe QuizQuestion::AnswerSerializers::ShortAnswer do
|
||||
it_should_behave_like 'Answer Serializers'
|
||||
include_examples 'Answer Serializers'
|
||||
|
||||
let :input do
|
||||
'hello world!'
|
||||
|
@ -26,6 +26,6 @@ describe QuizQuestion::AnswerSerializers::ShortAnswer do
|
|||
end
|
||||
|
||||
context 'validations' do
|
||||
it_should_behave_like 'Textual Answer Serializers'
|
||||
include_examples 'Textual Answer Serializers'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ require File.expand_path(File.dirname(__FILE__) + '/common.rb')
|
|||
|
||||
describe QuizStatistics::ItemAnalysis do
|
||||
let(:report_type) { 'item_analysis' }
|
||||
it_should_behave_like "QuizStatistics::Report"
|
||||
include_examples "QuizStatistics::Report"
|
||||
end
|
||||
|
||||
describe QuizStatistics::ItemAnalysis do
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/common.rb')
|
|||
|
||||
describe QuizStatistics::StudentAnalysis do
|
||||
let(:report_type) { 'student_analysis' }
|
||||
it_should_behave_like "QuizStatistics::Report"
|
||||
include_examples "QuizStatistics::Report"
|
||||
end
|
||||
|
||||
describe QuizStatistics::StudentAnalysis do
|
||||
|
|
|
@ -39,7 +39,7 @@ describe Submission do
|
|||
Submission.create!(@valid_attributes)
|
||||
end
|
||||
|
||||
it_should_behave_like "url validation tests"
|
||||
include_examples "url validation tests"
|
||||
it "should check url validity" do
|
||||
test_url_validation(Submission.create!(@valid_attributes))
|
||||
end
|
||||
|
|
|
@ -110,7 +110,7 @@ describe "UserFollow" do
|
|||
end
|
||||
|
||||
context "follow from user shard" do
|
||||
it_should_behave_like "sharded user following"
|
||||
include_examples "sharded user following"
|
||||
|
||||
before do
|
||||
@uf = UserFollow.create_follow(@user1, @collection)
|
||||
|
@ -119,7 +119,7 @@ describe "UserFollow" do
|
|||
end
|
||||
|
||||
context "follow from thing shard" do
|
||||
it_should_behave_like "sharded user following"
|
||||
include_examples "sharded user following"
|
||||
|
||||
before do
|
||||
@uf = @collection.shard.activate { UserFollow.create_follow(@user1, @collection) }
|
||||
|
@ -128,7 +128,7 @@ describe "UserFollow" do
|
|||
end
|
||||
|
||||
context "follow from a third shard" do
|
||||
it_should_behave_like "sharded user following"
|
||||
include_examples "sharded user following"
|
||||
|
||||
before do
|
||||
@uf = @shard2.activate { UserFollow.create_follow(@user1, @collection) }
|
||||
|
|
|
@ -20,7 +20,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
|
|||
require_relative('web_conference_spec_helper')
|
||||
|
||||
describe WimbaConference do
|
||||
it_should_behave_like 'WebConference'
|
||||
include_examples 'WebConference'
|
||||
|
||||
# implements this WebConference option:
|
||||
it { should respond_to :admin_settings_url }
|
||||
|
|
|
@ -4,6 +4,6 @@ require File.expand_path(File.dirname(__FILE__) + '/../helpers/basic/question_ba
|
|||
describe "account admin question banks" do
|
||||
describe "shared question bank specs" do
|
||||
let(:url) { "/accounts/#{Account.default.id}/question_banks" }
|
||||
it_should_behave_like "question bank basic tests"
|
||||
include_examples "question bank basic tests"
|
||||
end
|
||||
end
|
|
@ -6,6 +6,6 @@ describe "account admin statistics" do
|
|||
let(:url) { "/accounts/#{Account.default.id}/statistics" }
|
||||
let(:account) { Account.default }
|
||||
let(:list_css) { {:created => '#recently_created_item_list', :started => '#recently_started_item_list', :ended => '#recently_ended_item_list', :logged_in => '#recently_logged_in_item_list'} }
|
||||
it_should_behave_like "statistics basic tests"
|
||||
include_examples "statistics basic tests"
|
||||
end
|
||||
end
|
|
@ -46,7 +46,7 @@ describe "settings tabs" do
|
|||
end
|
||||
|
||||
describe "site admin" do
|
||||
it_should_behave_like "external tools tests"
|
||||
include_examples "external tools tests"
|
||||
before(:each) do
|
||||
# course_with_
|
||||
site_admin_logged_in
|
||||
|
@ -85,7 +85,7 @@ describe "settings tabs" do
|
|||
end
|
||||
|
||||
describe "admin" do
|
||||
it_should_behave_like "external tools tests"
|
||||
include_examples "external tools tests"
|
||||
before(:each) do
|
||||
course_with_admin_logged_in
|
||||
get "/accounts/#{Account.default.id}/settings"
|
||||
|
@ -194,6 +194,6 @@ describe 'shared settings specs' do
|
|||
let(:account) { Account.default }
|
||||
let(:account_settings_url) { "/accounts/#{Account.default.id}/settings" }
|
||||
let(:admin_tab_url) { "/accounts/#{Account.default.id}/settings#tab-users" }
|
||||
it_should_behave_like "settings basic tests"
|
||||
include_examples "settings basic tests"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ describe "admin courses tab" do
|
|||
let(:account) { Account.default }
|
||||
let(:url) { "/accounts/#{account.id}/users" }
|
||||
let(:opts) { {:name => 'student'} }
|
||||
it_should_behave_like "users basic tests"
|
||||
include_examples "users basic tests"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ describe "account permissions" do
|
|||
describe "shared permission specs" do
|
||||
let(:url) { "/accounts/#{Account.default.id}/permissions?account_roles=1" }
|
||||
let(:account) { Account.default }
|
||||
it_should_behave_like "permission tests"
|
||||
include_examples "permission tests"
|
||||
end
|
||||
end
|
|
@ -5,6 +5,6 @@ describe "sub account permissions" do
|
|||
describe "shared permission specs" do
|
||||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
let(:url) { "/accounts/#{account.id}/permissions?account_roles=1" }
|
||||
it_should_behave_like "permission tests"
|
||||
include_examples "permission tests"
|
||||
end
|
||||
end
|
|
@ -5,6 +5,6 @@ describe "sub account question banks" do
|
|||
describe "shared question bank specs" do
|
||||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
let(:url) { "/accounts/#{account.id}/question_banks" }
|
||||
it_should_behave_like "question bank basic tests"
|
||||
include_examples "question bank basic tests"
|
||||
end
|
||||
end
|
|
@ -6,6 +6,6 @@ describe "sub account settings" do
|
|||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
let(:account_settings_url) { "/accounts/#{account.id}/settings" }
|
||||
let(:admin_tab_url) { "/accounts/#{account.id}/settings#tab-users" }
|
||||
it_should_behave_like "settings basic tests"
|
||||
include_examples "settings basic tests"
|
||||
end
|
||||
end
|
|
@ -6,6 +6,6 @@ describe "sub account statistics" do
|
|||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
let(:url) { "/accounts/#{account.id}/statistics" }
|
||||
let(:list_css) { {:started => '#recently_started_item_list', :ended => '#recently_ended_item_list', :logged_in => '#recently_logged_in_item_list'} }
|
||||
it_should_behave_like "statistics basic tests"
|
||||
include_examples "statistics basic tests"
|
||||
end
|
||||
end
|
|
@ -6,6 +6,6 @@ describe "sub account users" do
|
|||
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
|
||||
let(:url) { "/accounts/#{account.id}/users" }
|
||||
let(:opts) { {:name => 'student'} }
|
||||
it_should_behave_like "users basic tests"
|
||||
include_examples "users basic tests"
|
||||
end
|
||||
end
|
|
@ -173,7 +173,7 @@ describe "admin_tools" do
|
|||
end
|
||||
|
||||
context "Logging" do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
it "should change log types with dropdown" do
|
||||
load_admin_tools_page
|
||||
|
@ -275,7 +275,7 @@ describe "admin_tools" do
|
|||
end
|
||||
|
||||
context "Authentication Logging" do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
before do
|
||||
Auditors::Authentication.record(@student.pseudonyms.first, 'login')
|
||||
|
@ -304,7 +304,7 @@ describe "admin_tools" do
|
|||
end
|
||||
|
||||
context "Grade Change Logging" do
|
||||
it_should_behave_like "cassandra audit logs"
|
||||
include_examples "cassandra audit logs"
|
||||
|
||||
before do
|
||||
course_with_teacher(course: @course, :user => user_with_pseudonym(:name => 'Teacher TestUser'))
|
||||
|
|
|
@ -16,15 +16,6 @@
|
|||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../../config/canvas_rails3')
|
||||
if CANVAS_RAILS2
|
||||
Spec::Example::ExampleGroupMethods.module_eval do
|
||||
def include_examples(*args)
|
||||
it_should_behave_like(*args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
||||
require "selenium-webdriver"
|
||||
require "socket"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "equation editor" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
it "should support multiple equation editors on the same page" do
|
||||
pending("193")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/external_tools_common')
|
||||
|
||||
describe "external tools" do
|
||||
it_should_behave_like "external tools tests"
|
||||
include_examples "external tools tests"
|
||||
|
||||
describe "app center" do
|
||||
before (:each) do
|
||||
|
@ -97,7 +97,7 @@ describe "external tools" do
|
|||
end
|
||||
|
||||
describe "editing external tools" do
|
||||
it_should_behave_like "external tools tests"
|
||||
include_examples "external tools tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -93,7 +93,7 @@ describe "public courses" do
|
|||
@course
|
||||
end
|
||||
|
||||
it_should_behave_like 'a public course'
|
||||
include_examples 'a public course'
|
||||
end
|
||||
|
||||
context 'with draft state enabled' do
|
||||
|
@ -104,7 +104,7 @@ describe "public courses" do
|
|||
@course
|
||||
end
|
||||
|
||||
it_should_behave_like 'a public course'
|
||||
include_examples 'a public course'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "quizzes attempts" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "One Question at a Time Quizzes" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
def create_oqaat_quiz(opts={})
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "quizzes question banks" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "quizzes question creation" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -113,10 +113,10 @@ describe "self enrollment" do
|
|||
}
|
||||
|
||||
context "with open registration" do
|
||||
it_should_behave_like "open registration"
|
||||
include_examples "open registration"
|
||||
end
|
||||
context "without open registration" do
|
||||
it_should_behave_like "closed registration"
|
||||
include_examples "closed registration"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -133,10 +133,10 @@ describe "self enrollment" do
|
|||
f('#dashboard').should include_text("You've enrolled in one or more courses that have not started yet")
|
||||
}
|
||||
context "with open registration" do
|
||||
it_should_behave_like "open registration"
|
||||
include_examples "open registration"
|
||||
end
|
||||
context "without open registration" do
|
||||
it_should_behave_like "closed registration"
|
||||
include_examples "closed registration"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -149,10 +149,10 @@ describe "self enrollment" do
|
|||
f('#dashboard').should include_text("You've enrolled in one or more courses that have not started yet")
|
||||
}
|
||||
context "with open registration" do
|
||||
it_should_behave_like "open registration"
|
||||
include_examples "open registration"
|
||||
end
|
||||
context "without open registration" do
|
||||
it_should_behave_like "closed registration"
|
||||
include_examples "closed registration"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "quizzes" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
def prepare_quiz
|
||||
@quiz = quiz_model({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "quizzes questions" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
before (:each) do
|
||||
course_with_teacher_logged_in
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/assignment_overrides
|
|||
|
||||
describe "quizzes" do
|
||||
include AssignmentOverridesSeleniumHelper
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
context "as a teacher" do
|
||||
let(:due_at) { Time.zone.now }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "quiz statistics" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
describe "item analysis" do
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
||||
|
||||
describe "quizzes students" do
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
context "as a teacher " do
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/quizzes_common')
|
|||
|
||||
describe "Wiki pages and Tiny WYSIWYG editor Images" do
|
||||
include_examples "in-process server selenium tests"
|
||||
it_should_behave_like "quizzes selenium tests"
|
||||
include_examples "quizzes selenium tests"
|
||||
|
||||
context "wiki and tiny images as a teacher" do
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ describe QuizSubmissionService do
|
|||
lambda { |*_| subject.create quiz }
|
||||
end
|
||||
|
||||
it_should_behave_like 'Takeable Quiz Services'
|
||||
include_examples 'Takeable Quiz Services'
|
||||
|
||||
it 'should create a QS' do
|
||||
expect { subject.create quiz }.to_not raise_error
|
||||
|
@ -171,7 +171,7 @@ describe QuizSubmissionService do
|
|||
lambda { |*_| subject.complete qs, qs.attempt }
|
||||
end
|
||||
|
||||
it_should_behave_like 'Takeable Quiz Services'
|
||||
include_examples 'Takeable Quiz Services'
|
||||
|
||||
it 'should complete the QS' do
|
||||
expect do
|
||||
|
@ -240,7 +240,7 @@ describe QuizSubmissionService do
|
|||
lambda { |*_| subject.update_question({}, qs, qs.attempt) }
|
||||
end
|
||||
|
||||
it_should_behave_like 'Takeable Quiz Services'
|
||||
include_examples 'Takeable Quiz Services'
|
||||
|
||||
it 'should update a question' do
|
||||
expect do
|
||||
|
|
|
@ -16,6 +16,15 @@
|
|||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__) + '/../config/canvas_rails3')
|
||||
if CANVAS_RAILS2
|
||||
Spec::Example::ExampleGroupMethods.module_eval do
|
||||
def include_examples(*args)
|
||||
it_should_behave_like(*args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
begin; require File.expand_path(File.dirname(__FILE__) + "/../parallelized_specs/lib/parallelized_specs.rb"); rescue LoadError; end
|
||||
|
||||
ENV["RAILS_ENV"] = 'test'
|
||||
|
|
|
@ -176,7 +176,7 @@ describe "communication_channels/confirm.html.erb" do
|
|||
@user.update_attribute(:workflow_state, 'creation_pending')
|
||||
assigns[:pseudonym] = @user.pseudonyms.build(:account => Account.default)
|
||||
end
|
||||
it_should_behave_like "user registration"
|
||||
include_examples "user registration"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -240,6 +240,6 @@ describe "communication_channels/confirm.html.erb" do
|
|||
assigns[:pseudonym] = @user.pseudonyms.create!(:unique_id => 'johndoe@example.com')
|
||||
end
|
||||
|
||||
it_should_behave_like "user registration"
|
||||
include_examples "user registration"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ describe 'Delayed::Backed::ActiveRecord::Job' do
|
|||
Delayed::Job::Failed.delete_all
|
||||
end
|
||||
|
||||
it_should_behave_like 'a delayed_jobs implementation'
|
||||
include_examples 'a delayed_jobs implementation'
|
||||
|
||||
it "should recover as well as possible from a failure failing a job" do
|
||||
Delayed::Job::Failed.stubs(:create).raises(RuntimeError)
|
||||
|
|
|
@ -105,11 +105,11 @@ shared_examples_for 'Delayed::Batch' do
|
|||
end
|
||||
|
||||
describe "current_shard" do
|
||||
it_should_behave_like "delayed_jobs_shards"
|
||||
include_examples "delayed_jobs_shards"
|
||||
|
||||
context "sharding" do
|
||||
specs_require_sharding
|
||||
it_should_behave_like "delayed_jobs_shards"
|
||||
include_examples "delayed_jobs_shards"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ describe 'Delayed::Backend::Redis::Job' do
|
|||
Delayed::Job.redis.flushdb
|
||||
end
|
||||
|
||||
it_should_behave_like 'a delayed_jobs implementation'
|
||||
include_examples 'a delayed_jobs implementation'
|
||||
|
||||
describe "tickle_strand" do
|
||||
it "should continue trying to tickle until the strand is empty" do
|
||||
|
|
|
@ -636,7 +636,7 @@ shared_examples_for 'a backend' do
|
|||
end
|
||||
|
||||
describe "scope: current" do
|
||||
it_should_behave_like "scope"
|
||||
include_examples "scope"
|
||||
before do
|
||||
@flavor = 'current'
|
||||
Timecop.freeze(5.minutes.ago) do
|
||||
|
@ -648,7 +648,7 @@ shared_examples_for 'a backend' do
|
|||
end
|
||||
|
||||
describe "scope: future" do
|
||||
it_should_behave_like "scope"
|
||||
include_examples "scope"
|
||||
before do
|
||||
@flavor = 'future'
|
||||
Timecop.freeze(5.minutes.ago) do
|
||||
|
@ -660,7 +660,7 @@ shared_examples_for 'a backend' do
|
|||
end
|
||||
|
||||
describe "scope: strand" do
|
||||
it_should_behave_like "scope"
|
||||
include_examples "scope"
|
||||
before do
|
||||
@flavor = 'strand'
|
||||
@query = 's1'
|
||||
|
@ -675,7 +675,7 @@ shared_examples_for 'a backend' do
|
|||
end
|
||||
|
||||
describe "scope: tag" do
|
||||
it_should_behave_like "scope"
|
||||
include_examples "scope"
|
||||
before do
|
||||
@flavor = 'tag'
|
||||
@query = 'String#to_i'
|
||||
|
|
|
@ -6,10 +6,10 @@ require File.expand_path('../stats_spec', __FILE__)
|
|||
require File.expand_path('../worker_spec', __FILE__)
|
||||
|
||||
shared_examples_for 'a delayed_jobs implementation' do
|
||||
it_should_behave_like 'a backend'
|
||||
it_should_behave_like 'Delayed::Batch'
|
||||
it_should_behave_like 'random ruby objects'
|
||||
it_should_behave_like 'Delayed::PerformableMethod'
|
||||
it_should_behave_like 'Delayed::Stats'
|
||||
it_should_behave_like 'Delayed::Worker'
|
||||
include_examples 'a backend'
|
||||
include_examples 'Delayed::Batch'
|
||||
include_examples 'random ruby objects'
|
||||
include_examples 'Delayed::PerformableMethod'
|
||||
include_examples 'Delayed::Stats'
|
||||
include_examples 'Delayed::Worker'
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ module Wiziq
|
|||
describe WiziqConference do
|
||||
include Wiziq
|
||||
|
||||
it_should_behave_like 'WebConference'
|
||||
include_examples 'WebConference'
|
||||
|
||||
before(:each) do
|
||||
PluginSetting.create!(:name => 'wiziq', :settings => { :api_url => 'http://wiziq.com/', :access_key => 'test_access_key', :secret_key => 'test_secret_key' })
|
||||
|
|
Loading…
Reference in New Issue