spec: selenium updates for rails 3

in particular, change "it_should_behave_like" to
"include_examples" (in rails 3, "it_should_behave_like"
does not extend the defined methods to nested examples)

Change-Id: I24c3d0a214e763cd61bbe73e055f610e021fddd0
Reviewed-on: https://gerrit.instructure.com/28157
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:
James Williams 2013-12-28 15:32:38 -07:00
parent 507fe54e27
commit 86384632e3
131 changed files with 161 additions and 144 deletions

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "account" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_admin_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "account admin courses tab" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def add_course(course_name, has_student = false)
Account.default.courses.create(:name => course_name).offer!

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../common')
require File.expand_path(File.dirname(__FILE__) + '/../helpers/grading_schemes_common')
describe "account admin grading schemes" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
let(:account) { Account.default }
let(:url) { "/accounts/#{Account.default.id}/grading_standards" }

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../helpers/manage_groups_com
require 'thread'
describe "account admin manage groups" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def add_account_category (account, name)
f(".add_category_link").click

View File

@ -4,7 +4,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../common')
require File.expand_path(File.dirname(__FILE__) + '/../helpers/outcome_common')
describe "account admin outcomes" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
let(:outcome_url) { "/accounts/#{Account.default.id}/outcomes" }
let(:who_to_login) { 'admin' }
let(:account) { Account.default }

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../common')
require File.expand_path(File.dirname(__FILE__) + '/../helpers/external_tools_common')
describe "account admin question bank" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before(:each) do
admin_logged_in

View File

@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../helpers/rubrics_common')
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "account shared rubric specs" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
let(:rubric_url) { "/accounts/#{Account.default.id}/rubrics" }
let(:who_to_login) { 'admin' }

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "sis imports ui" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def account_with_admin_logged_in(opts = {})
@account = Account.default

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "account admin terms" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def click_term_action_link(term_div, action_link_css)
term_div.find_element(:css, action_link_css).click

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "admin avatars" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_admin_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "admin settings tab" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_admin_logged_in
get "/accounts/#{Account.default.id}/settings"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "admin sub accounts" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
DEFAULT_ACCOUNT_ID = Account.default.id
def create_sub_account(name = 'sub account', number_to_create = 1, parent_account = Account.default)

View File

@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../helpers/shared_user_metho
require File.expand_path(File.dirname(__FILE__) + '/../helpers/basic/users_specs')
describe "admin courses tab" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "add user basic" do
describe "shared users specs" do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "assignments" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as an admin" do
before do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "Account Authorization Configs" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "Server errors " do
it "should show the error message generated by the server" do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "managing developer keys" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before :each do
account_admin_user(:account => Account.site_admin)

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
describe "site admin jobs ui" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
module FlavorTags
ALL = 'All'

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../common')
describe "sub account courses" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
let(:url) { "/accounts/#{account.id}" }

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../common')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/grading_schemes_common')
describe "sub account grading schemes" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
let(:url) { "/accounts/#{account.id}/grading_standards" }

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../common')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/outcome_common')
describe "sub account outcomes" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
describe "account outcome specs" do
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../common')
require File.expand_path(File.dirname(__FILE__) + '/../../helpers/rubrics_common')
describe "sub account shared rubric specs" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
let(:account) { Account.create(:name => 'sub account from default account', :parent_account => Account.default) }
let(:rubric_url) { "/accounts/#{account.id}/rubrics" }
let(:who_to_login) { 'admin' }

View File

@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/calendar2_common')
require File.expand_path(File.dirname(__FILE__) + '/../cassandra_spec_helper')
describe "admin_tools" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def load_admin_tools_page
get "/accounts/#{@account.id}/admin_tools"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "Alerts" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
@context = Account.default

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "announcements" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def create_announcement(message = 'announcement message')
@context = @course

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "Authenticity Tokens" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
it "should change the authenticity token on each request" do
user_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/assignments_common')
describe "discussion assignments" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "external tool assignments" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "assignment groups" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def get_assignment_groups
ff('#groups .assignment_group')

View File

@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/assignment_overrides
describe "assignment groups" do
include AssignmentOverridesSeleniumHelper
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as a teacher" do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/assignments_common')
describe "quizzes assignments" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "assignment rubrics" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "assignment rubrics as a teacher" do
before (:each) do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "assignments" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as a teacher" do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "assignments" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as a student" do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "assignments turn it in" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/calendar2_common')
describe "calendar2" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
Account.default.tap do |a|

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "calendar" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def go_to_calendar
get "/calendar"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "collaborations" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
# Helper methods
# ==============

View File

@ -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
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require "selenium-webdriver"
require "socket"
@ -191,10 +200,14 @@ module SeleniumTestsHelperMethods
def self.rack_app()
app = Rack::Builder.new do
use Rails::Rack::Debugger unless Rails.env.test?
if CANVAS_RAILS2
map '/' do
use Rails::Rack::Static
run ActionController::Dispatcher.new
end
else
run CanvasRails::Application
end
end.to_app
return app
end
@ -275,7 +288,11 @@ shared_examples_for "all selenium tests" do
include CustomSeleniumRspecMatchers
# set up so you can use rails urls helpers in your selenium tests
if CANVAS_RAILS2
include ActionController::UrlWriter
else
include Rails.application.routes.url_helpers
end
def selenium_driver;
$selenium_driver
@ -1058,7 +1075,7 @@ def find_css_in_string(string_of_html, css_selector)
end
shared_examples_for "in-process server selenium tests" do
it_should_behave_like "all selenium tests"
include_examples "all selenium tests"
prepend_before (:all) do
$in_proc_webserver_shutdown ||= SeleniumTestsHelperMethods.start_webserver(WEBSERVER)
end

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "communication channel selenium tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "confirm" do
it "should register the user" do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "concluded/unconcluded" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
username = "nobody@example.com"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
describe "web conference" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "content exports" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as a teacher" do

View File

@ -146,7 +146,7 @@ def test_selective_content(source_course=nil)
end
describe "content migrations" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "common cartridge importing" do
before :each do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "courses" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before do
course_with_student_logged_in(:active_all => true)

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/context_modules_common')
describe "context_modules" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as a teacher" do
before (:each) do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
describe "context_modules" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as a student" do
def create_context_module(module_name)

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations attachments local tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before do
conversation_setup
@ -140,7 +140,7 @@ describe "conversations attachments local tests" do
end
describe "conversations attachments S3 tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before do
conversation_setup

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations context filtering" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
conversation_setup

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations group" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before(:each) do
conversation_setup

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations new" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def conversations_url
"/conversations"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations recipient finder" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def conversations_path(params={})
hash = params.to_json.unpack('H*').first

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations sent filter" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
conversation_setup

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
conversation_setup

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations submissions" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
conversation_setup

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/conversations_common')
describe "conversations user notes" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before(:each) do
conversation_setup

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "course copy" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def validate_course_main_page
header = f('#section-tabs-header')

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "course sections" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def add_enrollment(enrollment_state, section)
enrollment = student_in_course(:workflow_state => enrollment_state, :course_section => section)

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "course settings" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in :limit_privileges_to_course_section => false

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "course statistics" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "courses" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as a teacher" do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "cross-listing" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before do
course_with_teacher_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "dashboard" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "as a student" do

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "default plugins" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before(:each) do
user_logged_in

View File

@ -2,7 +2,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/discussions_common')
describe "discussions" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
let(:course) { course_model.tap(&:offer!) }
let(:default_section) { course.default_section }

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/discussions_common')
describe "threaded discussions" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
@topic_title = 'threaded discussion topic'

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "enhanceable_content" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
it "should automatically enhance content using jQuery UI" do
stub_kaltura

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "eportfolios" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def create_eportfolio(is_public = false)
get "/dashboard/eportfolios"
@ -265,7 +265,7 @@ describe "eportfolios" do
end
describe "eportfolios file upload" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
@password = "asdfasdf"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "error reporting" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
it "should log the same error at most 1 time per 5 seconds" do
get('/logout')

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "external tool buttons" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/common')
require File.expand_path(File.dirname(__FILE__) + '/helpers/files_common')
describe "shared files tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def fixture_file_path(file)
path = ActionController::TestCase.respond_to?(:fixture_path) ? ActionController::TestCase.send(:fixture_path) : nil
@ -189,7 +189,7 @@ end
describe "zip file uploads" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "courses" do
before do

View File

@ -59,7 +59,7 @@ def file_setup
end
describe "common file behaviors" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def add_file(file_fullpath)
attachment_field = keep_trying_until do
@ -168,7 +168,7 @@ describe "common file behaviors" do
end
describe "files without s3 and forked tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
@folder_name = "my folder"
@ -219,7 +219,7 @@ describe "files without s3 and forked tests" do
end
describe "course files" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
it "should not show root folder files in the collaborations folder when there is a collaboration" do
course_with_teacher_logged_in
@ -252,7 +252,7 @@ describe "course files" do
end
describe "scribd re-rendering" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before do
ScribdAPI.stubs(:config).returns({ :key => "key", :secret => "what" })

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "google analytics" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
it "should not include tracking script if not asked to" do
get "/"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "grade exchange course settings tab" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def getpseudonym(user_sis_id)
pseudo = Pseudonym.find_by_sis_user_id(user_sis_id)

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
describe "assignment column headers" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
ASSIGNMENT_1_POINTS = "10"
ASSIGNMENT_2_POINTS = "5"

View File

@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
describe "edititing grades" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
ASSIGNMENT_1_POINTS = "10"
ASSIGNMENT_2_POINTS = "5"

View File

@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
describe "group weights" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
ASSIGNMENT_1_POINTS = "10"
ASSIGNMENT_2_POINTS = "5"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/gradebook2_common')
describe "gradebook2" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
ASSIGNMENT_1_POINTS = "10"
ASSIGNMENT_2_POINTS = "5"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
describe "gradebook uploads" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before do
course_with_teacher_logged_in(:active_all => 1, :username => 'teacher@example.com')

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
describe "gradebook1" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before(:each) do
course_with_teacher_logged_in(:active_all => true)

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
describe "grades" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher(:active_all => true)

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "grading standards" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
it "should allow creating/deleting grading standards" do
course_with_teacher_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "groups" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
it "should allow students to join self signup groups" do
course_with_student_logged_in(:active_all => true)

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + "/common")
require 'lib/handlebars/handlebars'
describe "handlebars" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "help dialog" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
context "no user logged in" do
it "should work with no logged in user" do

View File

@ -1,5 +1,5 @@
shared_examples_for "permission tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_admin_logged_in

View File

@ -1,5 +1,5 @@
shared_examples_for "question bank basic tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
admin_logged_in
get url

View File

@ -1,5 +1,5 @@
shared_examples_for "settings basic tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_admin_logged_in

View File

@ -1,5 +1,5 @@
shared_examples_for "statistics basic tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def item_lists
ff('.item_list')

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../..//helpers/shared_user_methods')
shared_examples_for "users basic tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
it "should add a new user" do
pending('newly added user in sub account does not show up') if account != Account.default

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
shared_examples_for "external tools tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def add_external_tool (*opts)
name = "external tool"

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../common')
shared_examples_for "quizzes selenium tests" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def create_multiple_choice_question
question = fj(".question_form:visible")

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
describe "i18n js" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
describe "jquery" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
# jquery keeps breaking attr() ... see http://bugs.jquery.com/ticket/10278

View File

@ -3,7 +3,7 @@
require File.expand_path(File.dirname(__FILE__) + "/common")
describe "jquery ui" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
def active
driver.switch_to.active_element

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "layout" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_student_logged_in

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/manage_groups_common
require 'thread'
describe "manage groups" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/helpers/manage_groups_common
require 'thread'
describe "manage groups students" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in

View File

@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/common')
describe "oauth2 flow" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before do
@key = DeveloperKey.create!(:name => 'Specs', :redirect_uri => 'http://www.example.com')
@ -50,7 +50,7 @@ describe "oauth2 flow" do
end
describe "oauth2 tool icons" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before do
course_with_student_logged_in(:active_all => true)
end

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/helpers/outcome_common')
describe "outcomes" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
let(:who_to_login) { 'teacher' }
let(:outcome_url) { "/courses/#{@course.id}/outcomes" }

View File

@ -1,7 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "course people" do
it_should_behave_like "in-process server selenium tests"
include_examples "in-process server selenium tests"
before (:each) do
course_with_teacher_logged_in :limit_privileges_to_course_section => false

Some files were not shown because too many files have changed in this diff Show More