spec: fix spec files that don't end in _spec.rb

turns out they never got run

test plan:
* specs

closes #CNVS-24199

Change-Id: I0b99b18d93c168ac272fc8adc197885dd415cda3
Reviewed-on: https://gerrit.instructure.com/65645
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
This commit is contained in:
James Williams 2015-10-22 10:58:04 -06:00
parent aaee3c6647
commit 2939226855
18 changed files with 24 additions and 112 deletions

View File

@ -27,21 +27,22 @@ describe Canvas::LiveEvents do
@page = @course.wiki.wiki_pages.create(:title => "old title", :body => "old body")
end
it "should not set old_title or old_body if they don't change" do
@page.save
def wiki_page_updated
Canvas::LiveEvents.wiki_page_updated(@page, @page.title_changed? ? @page.title_was : nil, @page.body_changed? ? @page.body_was : nil)
end
it "should not set old_title or old_body if they don't change" do
LiveEvents.expects(:post_event).with('wiki_page_updated', {
wiki_page_id: @page.global_id,
title: "old title",
body: "old body"
})
Canvas::LiveEvents.wiki_page_updated(@page)
wiki_page_updated
end
it "should set old_title if the title changed" do
@page.title = "new title"
@page.save
LiveEvents.expects(:post_event).with('wiki_page_updated', {
wiki_page_id: @page.global_id,
@ -50,12 +51,11 @@ describe Canvas::LiveEvents do
body: "old body"
})
Canvas::LiveEvents.wiki_page_updated(@page)
wiki_page_updated
end
it "should set old_body if the body changed" do
@page.body = "new body"
@page.save
LiveEvents.expects(:post_event).with('wiki_page_updated', {
wiki_page_id: @page.global_id,
@ -64,7 +64,7 @@ describe Canvas::LiveEvents do
old_body: "old body"
})
Canvas::LiveEvents.wiki_page_updated(@page)
wiki_page_updated
end
end

View File

@ -64,26 +64,26 @@ describe 'DataFixup::PopulateConversationMessageProperties' do
expect(c1.has_media_objects?).to be_falsey
expect(m1.read_attribute(:has_attachments)).to be_falsey
expect(m1.read_attribute(:has_media_objects)).to be_falsey
expect(m1.attachment_ids).to be_nil
expect(m1.media_comment).to be_nil
expect(m1.attachment_ids).to be_blank
expect(m1.media_comment).to be_blank
expect(c2.has_attachments?).to be_truthy
expect(c2.has_media_objects?).to be_falsey
expect(m2.read_attribute(:has_attachments)).to be_truthy
expect(m2.read_attribute(:has_media_objects)).to be_falsey
expect(m2.attachment_ids).to eql a.id.to_s
expect(m2.attachment_ids).to eql [a.id]
expect(c3.has_attachments?).to be_truthy
expect(c3.has_media_objects?).to be_falsey
expect(m3.read_attribute(:has_attachments)).to be_truthy
expect(m3.read_attribute(:has_media_objects)).to be_falsey
expect(m3.attachment_ids).to be_nil # it's on the forwarded message
expect(m3.attachment_ids).to be_blank # it's on the forwarded message
expect(c4.has_attachments?).to be_truthy
expect(c4.has_media_objects?).to be_falsey
expect(m4.read_attribute(:has_attachments)).to be_truthy
expect(m4.read_attribute(:has_media_objects)).to be_falsey
expect(m4.attachment_ids).to be_nil
expect(m4.attachment_ids).to be_blank
expect(c5.has_attachments?).to be_falsey
expect(c5.has_media_objects?).to be_truthy
@ -95,13 +95,13 @@ describe 'DataFixup::PopulateConversationMessageProperties' do
expect(c6.has_media_objects?).to be_truthy
expect(m6.read_attribute(:has_attachments)).to be_falsey
expect(m6.read_attribute(:has_media_objects)).to be_truthy
expect(m6.media_comment).to be_nil
expect(m6.media_comment).to be_blank
expect(c7.has_attachments?).to be_falsey
expect(c7.has_media_objects?).to be_truthy
expect(m7.read_attribute(:has_attachments)).to be_falsey
expect(m7.read_attribute(:has_media_objects)).to be_truthy
expect(m7.media_comment).to be_nil
expect(m7.media_comment).to be_blank
end
end
end

View File

@ -1,89 +0,0 @@
#
# Copyright (C) 2011 Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
DOCS_FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures/google_docs/'
def load_fixture_entry(filename)
GoogleDocEntry.new(File.read(DOCS_FIXTURES_PATH + filename))
end
describe GoogleDocEntry do
context "to_hash" do
let(:entry) { load_fixture_entry("spreadsheet_document_id_only_entry.xml") }
let(:hash) { entry.to_hash }
it "should use the display name" do
expect(hash['name']).to eq entry.display_name
end
it "should have document_id, extension" do
expect(hash['document_id']).not_to be_empty
expect(hash['extension']).not_to be_empty
end
it "should have alternate_url" do
expect(hash['alternate_url']).to eq 'http://docs.google.com'
end
end
context "extension" do
it "should be nil if no document_id or content type" do
entry = load_fixture_entry("blank_entry.xml")
expect(entry.document_id).to be_empty
expect(entry.content_type).to be_nil
expect(entry.extension).to be_nil
end
it "should be nil if no content type and unknown document_id prefix" do
entry = load_fixture_entry("unknown_document_id_only_entry.xml")
expect(entry.document_id).not_to be_empty
expect(entry.content_type).to be_nil
expect(entry.extension).to be_nil
end
it "should detect correctly if no content type and known document_id prefix" do
entry = load_fixture_entry("spreadsheet_document_id_only_entry.xml")
expect(entry.document_id).to be_present
expect(entry.content_type).to be_nil
expect(entry.extension).to eq 'xls'
end
it "should be nil if no document_id and unknown content type" do
scribd_mime_type_model(:name => 'application/pdf', :extension => 'pdf')
entry = load_fixture_entry("unknown_content_type_only_entry.xml")
expect(entry.document_id).to be_empty
expect(entry.content_type).to be_present
expect(entry.extension).to be_nil
end
it "should detect correctly if no document_id and known content type" do
scribd_mime_type_model(:name => 'application/pdf', :extension => 'pdf')
entry = load_fixture_entry("pdf_content_type_only_entry.xml")
expect(entry.document_id).to be_empty
expect(entry.content_type).to be_present
expect(entry.extension).to eq 'pdf'
end
it "should prefer content type over document_id for detection" do
scribd_mime_type_model(:name => 'application/pdf', :extension => 'pdf')
entry = load_fixture_entry("conflicting_document_id_and_content_type_entry.xml")
expect(entry.document_id).to be_present
expect(entry.content_type).to be_present
expect(entry.extension).to eq 'pdf'
end
end
end

View File

@ -12,8 +12,7 @@ describe "post grades to sis" do
end
it "should create a discussion with the post grades to sis box checked", priority: "1", test_id: 150520 do
get "/courses/#{@course.id}/discussion_topics"
expect_new_page_load{f('#new-discussion-btn').click}
get "/courses/#{@course.id}/discussion_topics/new"
f('#discussion-title').send_keys('New Discussion Title')
type_in_tiny('textarea[name=message]', 'Discussion topic message body')
f('#use_for_grading').click
@ -26,8 +25,7 @@ describe "post grades to sis" do
it "should not have Post grades to SIS checkbox present when the feature is not configured", priority: "1", test_id: 246614 do
Account.default.set_feature_flag!('post_grades', 'off')
get "/courses/#{@course.id}/discussion_topics"
expect_new_page_load{f('#new-discussion-btn').click}
get "/courses/#{@course.id}/discussion_topics/new"
f('#use_for_grading').click
expect(f('#assignment_post_to_sis')).not_to be_present
end
@ -39,7 +37,7 @@ describe "post grades to sis" do
end
def get_post_grades_dialog
get "/courses/#{@course.id}/gradebook2"
get "/courses/#{@course.id}/gradebook"
expect(f('.post-grades-placeholder > button')).to be_displayed
f('.post-grades-placeholder > button').click
wait_for_ajaximations

View File

@ -289,7 +289,7 @@ require_relative "../common"
end
if submit
expect_new_page_load { f('#submit_quiz_button').click }
expect_new_page_load(true) { f('#submit_quiz_button').click }
keep_trying_until do
expect(f('.quiz-submission .quiz_score .score_value')).to be_displayed
end

View File

@ -85,6 +85,7 @@ end
shared_examples 'user settings profile pic gravatar link' do |context|
it 'opens the Gravatar homepage', priority: "1", test_id: pick_test_id(context, "69159", "403055", "403056") do
skip "depends on external service"
enable_avatars
get '/profile/settings'
f('.avatar.profile_pic_link.none').click
@ -122,7 +123,7 @@ end
# ======================================================================================================================
def enable_avatars
a = Account.default
a = Account.default.reload
a.enable_service('avatars')
a.settings[:enable_profiles] = true
a.save!

View File

@ -6,7 +6,7 @@ describe "quiz taking" do
include_examples 'in-process server selenium tests'
before :each do
course_with_student_logged_in
course_with_student_logged_in(:active_all => true)
@quiz = quiz_with_new_questions(!:goto_edit)
end

View File

@ -19,7 +19,8 @@ describe "quizzes section hierarchy" do
@new_section.save!
# create a quiz and assign it to the section with due dae after course end date
@quiz = quiz_with_multiple_type_questions(!:goto_edit)
@quiz = quiz_with_multiple_type_questions(false)
@quiz.reload
@override = @quiz.assignment_overrides.build
@override.set = @new_section
@override.due_at = Time.zone.now.advance(days:3)
@ -43,6 +44,7 @@ describe "quizzes section hierarchy" do
# make sure it does not create a blank submissions
expect(f(' .quiz_score')).not_to be_present
expect(f(' .quiz_duration')).not_to be_present
expect_new_page_load(true) { f('#section-tabs .quizzes').click }
end
context "section overrides course and term hierarchy" do