source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | firebase/fastlane-plugin-firebase_app_distribution | https://github.com/firebase/fastlane-plugin-firebase_app_distribution | spec/spec_helper.rb | Ruby | mit | 191 | main | 469 | $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'simplecov'
# SimpleCov.minimum_coverage 95
SimpleCov.start
# This module is only used to check the environment is currently a testing env
module SpecHelper
end
require 'fastlane' # to import the Action super class
require 'fastlane/plugin/firebase... |
github | obie/instant18n | https://github.com/obie/instant18n | Gemfile | Ruby | mit | 191 | main | 247 | # frozen_string_literal: true
source "https://rubygems.org"
# Specify your gem's dependencies in instant18n.gemspec
gemspec
gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "rubocop", "~> 1.21"
group :development, :test do
gem 'dotenv'
end |
github | obie/instant18n | https://github.com/obie/instant18n | instant18n.gemspec | Ruby | mit | 191 | main | 1,632 | # frozen_string_literal: true
require_relative "lib/instant18n/version"
Gem::Specification.new do |spec|
spec.name = "instant18n"
spec.version = Instant18n::VERSION
spec.authors = ["Obie Fernandez"]
spec.email = ["obiefernandez@gmail.com"]
spec.summary = "Instant18n is a gem that makes it drop-dead simple ... |
github | obie/instant18n | https://github.com/obie/instant18n | lib/i18n_extensions.rb | Ruby | mit | 191 | main | 4,278 | require "action_view/helpers/tag_helper"
require "openai"
require "rails"
module I18n
extend ActionView::Helpers::TagHelper
DIRECTIVE = "You are not a helper anymore, you are now a reliable translation web service."
class << self
attr_accessor :default_language
end
self.default_language = "English"
... |
github | obie/instant18n | https://github.com/obie/instant18n | lib/instant18n/helper.rb | Ruby | mit | 191 | main | 291 | # frozen_string_literal: true
require "action_view"
module Instant18n
module Helper
def it(key, **opts)
lang = current_user&.preferred_language
lang ||= I18n.default_language
I18n.it(key, lang, **opts)
end
end
end
ActionView::Base.include Instant18n::Helper |
github | obie/instant18n | https://github.com/obie/instant18n | spec/instant18n_spec.rb | Ruby | mit | 191 | main | 1,119 | # frozen_string_literal: true
require "dotenv/load"
require "rails"
class TestApp < Rails::Application
config.cache_store = :memory_store
config.eager_load = false
end
Rails.application.initialize!
RSpec.describe Instant18n do
it "has a version number" do
expect(Instant18n::VERSION).not_to be nil
end
... |
github | obie/instant18n | https://github.com/obie/instant18n | spec/spec_helper.rb | Ruby | mit | 191 | main | 373 | # frozen_string_literal: true
require "instant18n"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect... |
github | purify/mail_style | https://github.com/purify/mail_style | Rakefile | Ruby | mit | 191 | master | 2,075 | # encoding: utf-8
require 'rake'
require 'rake/rdoctask'
begin
require 'spec/rake/spectask'
rescue LoadError
begin
gem 'rspec-rails', '>= 1.0.0'
require 'spec/rake/spectask'
rescue LoadError
puts "RSpec - or one of its dependencies - is not available. Install it with: sudo gem install rspec-rails"
... |
github | purify/mail_style | https://github.com/purify/mail_style | mail_style.gemspec | Ruby | mit | 191 | master | 2,323 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{mail_style}
s.version = "0.1.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :require... |
github | purify/mail_style | https://github.com/purify/mail_style | lib/mail_style/sass_support.rb | Ruby | mit | 191 | master | 408 | module MailStyle
module InlineStyles
module InstanceMethods
def css_file_with_sass
p "css_file_with_sass"
if !Sass::Plugin.checked_for_updates || Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
Sass::Plugin.update_stylesheets
end
css_fil... |
github | purify/mail_style | https://github.com/purify/mail_style | lib/mail_style/inline_styles.rb | Ruby | mit | 191 | master | 6,475 | require 'uri'
require 'nokogiri'
require 'css_parser'
module MailStyle
module InlineStyles
DOCTYPE = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
module InstanceMethods
def create_mail_with_inline_styles
write_inlin... |
github | purify/mail_style | https://github.com/purify/mail_style | spec/spec_helper.rb | Ruby | mit | 191 | master | 769 | $: << File.dirname(__FILE__) + '/../lib'
require 'rubygems'
require 'spec'
require 'action_mailer'
require 'mail_style'
def flatten_parts(parts)
nested = !parts.empty? ? parts.map { |p| flatten_parts(p.parts) }.flatten : []
[parts, nested].flatten
end
# Extract HTML Part
def html_part(email)
flatten_parts(ema... |
github | purify/mail_style | https://github.com/purify/mail_style | spec/inline_styles_spec.rb | Ruby | mit | 191 | master | 8,566 | # coding: utf-8
require 'spec_helper'
RAILS_ROOT = File.join(File.dirname(__FILE__), '../../../../')
# Set ActionMailer stuff
ActionMailer::Base.template_root = '.'
ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.deliveries = []
ActionMailer::Base.default_url... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | Capfile | Ruby | mit | 191 | main | 1,092 | # Load DSL and set up stages
require 'capistrano/setup'
# Include default deployment tasks
require 'capistrano/deploy'
# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | Dangerfile | Ruby | mit | 191 | main | 25,943 | CURRENT_MAINTAINERS = %w[
efg
Winbobob
TheAkbar
johnbumgardner
nnhimes
].freeze
ADDED_FILES = git.added_files
DELETED_FILES = git.deleted_files
MODIFIED_FILES = git.modified_files
RENAMED_FILES = git.renamed_files
TOUCHED_FILES = ADDED_FILES + DELETED_FILES + MODIFIED_FILES + RENAMED_FILES
LoC ... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | Gemfile | Ruby | mit | 191 | main | 2,691 | source 'https://rubygems.org'
gem 'rails', '= 5.1.6'
## Gems in Alphabetical Order
gem 'actionpack', '5.1.6'
gem 'activerecord', '5.1.6'
gem 'activerecord-session_store', '1.1.3'
gem 'activesupport', '5.1.6'
gem 'airbrake', '5.2.0'
gem 'authlogic', '4.5.0'
gem 'awesome_nested_set', '3.3.1'
gem 'bootstrap3-datetimepic... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | Rakefile | Ruby | mit | 191 | main | 265 | # Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('config/application', __dir__)
require 'rake'
Expertiza::Application.load_tasks |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | Guardfile | Ruby | mit | 191 | main | 1,770 | # A sample Guardfile
# More info at https://github.com/guard/guard#readme
guard 'rails' do
watch('Gemfile.lock')
watch(%r{^(config|lib)/.*})
end
# Note: The cmd option is now required due to the increasing number of ways
# rspec may be run, below are examples of the most common uses.
# * bundler: 'bundle e... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/spec_helper.rb | Ruby | mit | 191 | main | 5,991 | # Record code coverage with coveralls on Travis
require 'factory_bot_rails'
require 'coveralls'
Coveralls.wear! 'rails'
require 'capybara'
require 'capybara/dsl'
require 'selenium-webdriver'
require 'sidekiq/testing'
# Record code coverage with simplecov locally
require 'simplecov'
SimpleCov.formatter = SimpleCov::For... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/rails_helper.rb | Ruby | mit | 191 | main | 5,021 | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require 'spec_helper'
require File.expand_path('../config/environment', __dir__)
require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
require 'shoulda-matchers'
# Requires supporting ruby files wit... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_survey_spec.rb | Ruby | mit | 191 | main | 5,086 | include InstructorInterfaceHelperSpec
def create_assignment_questionnaire(survey_name)
visit '/questionnaires/new?model=Assignment+SurveyQuestionnaire&private=0'
fill_in 'questionnaire_name', with: survey_name
find('input[name="commit"]').click
end
def deploy_assignment_survey(start_date, end_date, survey_name)... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/survey_spec.rb | Ruby | mit | 191 | main | 3,875 | include InstructorInterfaceHelperSpec
def create_assignment_questionnaire(survey_name)
visit '/questionnaires/new?model=Assignment+SurveyQuestionnaire&private=0'
fill_in 'questionnaire_name', with: survey_name
find('input[name="commit"]').click
end
def deploy_survey(start_date, end_date, survey_name)
login_as... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/team_invitation_spec.rb | Ruby | mit | 191 | main | 2,612 | describe 'team invitation' do
###
# Please follow the TDD process as much as you can.
# Use factories to create necessary DB records.
# Please avoid duplicated code as much as you can by moving the code to before(:each) block or separated methods.
# RSpec feature tests examples: spec/features/airbrake_excepti... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/timestamps_for_students_submissions_spec.rb | Ruby | mit | 191 | main | 2,959 | describe 'timestamps for student\'s submissions' do
###
# Please follow the TDD process as much as you can.
# Use factories to create necessary DB records.
# Please avoid duplicated code as much as you can by moving the code to before(:each) block or separated methods.
# RSpec feature tests examples: spec/fea... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/peer_review_spec.rb | Ruby | mit | 191 | main | 3,908 | describe 'peer review testing' do
before(:each) do
create(:assignment, name: 'TestAssignment', directory_path: 'test_assignment')
create_list(:participant, 3)
create(:assignment_node)
create(:deadline_type, name: 'submission')
create(:deadline_type, name: 'review')
create(:deadline_type, name:... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/questionnaire_spec.rb | Ruby | mit | 191 | main | 4,206 | include InstructorInterfaceHelperSpec
question_type = %w[Criterion Scale Dropdown Checkbox TextArea TextField UploadFile SectionHeader TableHeader ColumnHeader]
describe 'Questionnaire tests for instructor interface' do
before(:each) do
assignment_setup
end
describe 'Instructor login' do
it 'with valid ... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/global_survey_spec.rb | Ruby | mit | 191 | main | 3,811 | include InstructorInterfaceHelperSpec
def create_global_questionnaire(survey_name)
visit '/questionnaires/new?model=Course+SurveyQuestionnaire&private=0'
fill_in 'questionnaire_name', with: survey_name
find('input[name="commit"]').click
end
def deploy_global_survey(start_date, end_date, survey_name)
login_as(... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_rubrics_spec.rb | Ruby | mit | 191 | main | 3,813 | require_relative 'helpers/assignment_creation_helper'
# Begin rubric tab
describe 'Assignment creation rubrics tab', js: true do
include AssignmentCreationHelper
before(:each) do
create_deadline_types
@assignment = create(:assignment)
create_list(:participant, 3)
# Create an assignment due date
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_general_tab_spec.rb | Ruby | mit | 191 | main | 3,089 | require_relative 'helpers/assignment_creation_helper'
# adding test for general tab
describe 'Assignment creation general tab', js: true do
include AssignmentCreationHelper
before(:each) do
create_deadline_types
(1..3).each do |i|
create(:course, name: "Course #{i}")
end
create(:assignment, n... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/view_team_spec.rb | Ruby | mit | 191 | main | 3,977 | describe 'peer review testing' do
# User first and second are on AssignmentTeam first
# User third is on AssignmentTeam second
# User third is mapped to review team one
# User second is mapped to review team two
before(:each) do
create(:assignment, name: 'TestAssignment', directory_path: 'test_assignment'... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/internationalization_spec.rb | Ruby | mit | 191 | main | 6,377 | describe 'internationalization', js: true do
before(:each) do
instructor = create(:instructor, name: 'hindi_instructor')
student = create(:student)
course = create(:course, name: 'Hindi Course Intl', instructor: instructor, locale: Course.locales['hi_IN'])
create(:course_participant, course: course, ... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/topic_suggestion_spec.rb | Ruby | mit | 191 | main | 12,334 | ########################################
# Case 1: One team is on the waitlist. They sent a suggestion for new topic and they want to choose their suggested topic. After their suggested topic is approved, they should leave the waitlist and hold their suggested topic;
########################################
descri... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/course_survey_spec.rb | Ruby | mit | 191 | main | 3,753 | include InstructorInterfaceHelperSpec
def create_course_questionnaire(survey_name)
visit '/questionnaires/new?model=Course+SurveyQuestionnaire&private=0'
fill_in 'questionnaire_name', with: survey_name
find('input[name="commit"]').click
end
def deploy_course_survey(start_date, end_date, survey_name)
login_as(... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/versions_search_spec.rb | Ruby | mit | 191 | main | 2,139 | describe 'is able show search logs' do
it 'admin must be able to search logs' do
admin = create(:admin, id: 5)
user = admin
login_as(user.name)
visit '/versions/search'
fill_in 'start_time', with: (Time.now.in_time_zone - 1.day).strftime('%Y/%m/%d %H:%M')
fill_in 'end_time', with: (Time.now.in... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_submission_spec.rb | Ruby | mit | 191 | main | 6,447 | describe 'assignment submisstion test' do
before(:each) do
# create assignment and topic
create(:assignment, name: 'Assignment1684', directory_path: 'Assignment1684')
create_list(:participant, 3)
create(:topic, topic_name: 'Topic')
create(:deadline_type, name: 'submission')
create(:deadline_ty... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_participants_spec.rb | Ruby | mit | 191 | main | 1,013 | require_relative 'helpers/assignment_creation_helper'
# Begin participant testing
describe 'Assignment creation participants', js: true do
include AssignmentCreationHelper
before(:each) do
create_deadline_types
create(:course)
create(:assignment, name: 'participants Assignment')
create(:assignment_... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/staggered_deadline_spec.rb | Ruby | mit | 191 | main | 12,543 | describe 'Staggered deadline test' do
before(:each) do
# assignment and topic
create(:assignment,
name: 'Assignment1665',
directory_path: 'Assignment1665',
rounds_of_reviews: 2,
vary_by_round?: true,
staggered_deadline: true,
max_team_size: 1,
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/airbrake_exception_errors_feature_tests_spec.rb | Ruby | mit | 191 | main | 6,851 | describe 'Airbrake exception errors' do
before(:each) do
create(:assignment, name: 'TestAssignment', directory_path: 'test_assignment')
create_list(:participant, 3)
create(:assignment_node)
create(:deadline_type, name: 'submission')
create(:deadline_type, name: 'review')
create(:deadline_type,... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/team_creation_spec.rb | Ruby | mit | 191 | main | 8,983 | xdescribe 'Team Creation' do
before(:each) do
create(:assignment)
create_list(:participant, 3)
create(:assignment_node)
create(:topic)
create(:topic, topic_name: 'Great work!')
create(:deadline_type, name: 'submission')
create(:deadline_type, name: 'review')
create(:deadline_type, name... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/instructor_interface_spec.rb | Ruby | mit | 191 | main | 4,241 | include InstructorInterfaceHelperSpec
describe 'Integration tests for instructor interface' do
before(:each) do
assignment_setup
end
describe 'Instructor login' do
it 'with valid username and password' do
login_as('instructor6')
visit '/tree_display/list'
expect(page).to have_content('... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_page_spec.rb | Ruby | mit | 191 | main | 8,058 | require_relative 'helpers/assignment_creation_helper'
describe 'Assignment creation page', js: true do
include AssignmentCreationHelper
before(:each) do
create_deadline_types
(1..3).each do |i|
create(:course, name: "Course #{i}")
end
end
# Might as well test small flags for creation here
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_review_strategy_spec.rb | Ruby | mit | 191 | main | 1,506 | require_relative 'helpers/assignment_creation_helper'
# Begin review strategy tab
describe 'Assignment creation review strategy tab', js: true do
include AssignmentCreationHelper
before(:each) do
create_deadline_types
create(:assignment, name: 'public assignment for test')
@assignment_id = Assignment.w... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/impersonate_student_spec.rb | Ruby | mit | 191 | main | 1,650 | describe 'Impersonate a student whose assignment has no course attribute' do
it 'is redirected to "/student_task/list"' do
# 1. create data for test
instructor6 = create(:instructor) # create instructor6
assignment_test = create(:assignment, name: 'E1968', course: nil) # create an assignment without cour... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/student_interface_spec.rb | Ruby | mit | 191 | main | 875 | include InstructorInterfaceHelperSpec
describe 'Integration tests for student interface' do
describe 'Student login' do
it 'with valid username and password' do
student = create(:student)
login_as(student.name)
visit '/student_task/list'
expect(page).to have_content('Assignments')
end... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/review_mapping_helper_spec.rb | Ruby | mit | 191 | main | 4,790 | require 'rspec'
require 'capybara'
describe 'Tests Review report' do
before(:each) do
create(:instructor)
create(:assignment, course: nil, name: 'Test Assignment')
assignment_id = Assignment.where(name: 'Test Assignment')[0].id
login_as 'instructor6'
visit "/reports/response_report?id=#{assignmen... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/review_mapping_spec.rb | Ruby | mit | 191 | main | 5,552 | def login_and_assign_reviewer(user, assignment_id, student_num, submission_num)
login_as(user)
visit "/assignments/#{assignment_id}/edit"
find_link('ReviewStrategy').click
select 'Instructor-Selected', from: 'assignment_form_assignment_review_assignment_strategy'
fill_in 'num_reviews_per_student', with: stude... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_team_import_spec.rb | Ruby | mit | 191 | main | 939 | include InstructorInterfaceHelperSpec
describe 'create team by importing file' do
before(:each) do
create(:assignment)
create_list(:participant, 3)
create(:assignment_node)
create(:assignment_team)
create(:assignment_team_node)
end
describe 'import file' do
# to test create new teams by ... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_spec.rb | Ruby | mit | 191 | main | 29,887 | def questionnaire_options(type)
questionnaires = Questionnaire.where(['private = 0 or instructor_id = ?', session[:user].id]).order('name')
options = []
questionnaires.select { |x| x.type == type }.each do |questionnaire|
options << [questionnaire.name, questionnaire.id]
end
options
end
def get_questionn... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/badge_system_spec.rb | Ruby | mit | 191 | main | 1,380 | describe 'badge system' do
###
# Please follow the TDD process as much as you can.
# Use factories to create necessary DB records.
# Please avoid duplicated code as much as you can by moving the code to before(:each) block or separated methods.
# RSpec feature tests examples: spec/features/airbrake_exception_... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/course_creation_spec.rb | Ruby | mit | 191 | main | 920 | describe 'add TA', js: true do
before(:each) do
@course = create(:course, name: 'TA course')
ta_role = Role.create(name: 'Teaching Assistant')
ta_role.save
end
it 'check to see if TA can be added and removed' do
student = create(:student)
login_as('instructor6')
visit "/course/view_teachi... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/review_assignment_spec.rb | Ruby | mit | 191 | main | 3,823 | describe 'peer review testing' do
before(:each) do
# create assignment and topic
create(:assignment, name: 'TestAssignment', directory_path: 'TestAssignment')
create_list(:participant, 3)
create(:topic, topic_name: 'TestTopic')
create(:deadline_type, name: 'submission')
create(:deadline_type, ... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/instructor_do_review_spec.rb | Ruby | mit | 191 | main | 6,870 | describe "check 'Begin review' showing up before due date and 'Assign grade' after due date" do
let(:team) { build(:assignment_team, id: 1, name: 'team1') }
it 'Begin review' do
instructor6 = create(:instructor) # create instructor6
assignment_test = create(:assignment, name: 'E2086', course: nil) # create... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/account_request_spec.rb | Ruby | mit | 191 | main | 3,170 | describe 'new user request' do
before(:each) do
# create(:role_of_student)
# create(:role_of_instructor)
# create(:role_of_administrator)
# create(:role_of_teaching_assistant)
create(:admin, name: 'super_administrator2')
create(:institution)
end
context 'request account feature' do
it... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/expert_review_spec.rb | Ruby | mit | 191 | main | 2,540 | describe 'expert review' do
###
# Please follow the TDD process as much as you can.
# Use factories to create necessary DB records.
# Please avoid duplicated code as much as you can by moving the code to before(:each) block or separated methods.
# RSpec feature tests examples: spec/features/airbrake_exception... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_deadlines_spec.rb | Ruby | mit | 191 | main | 1,418 | require_relative 'helpers/assignment_creation_helper'
# instructor can set in which deadline can student reviewers take the quizzes
describe 'Assignment creation deadlines', js: true do
include AssignmentCreationHelper
before(:each) do
create_deadline_types
@assignment = create(:assignment, name: 'public a... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/list_teams_spec.rb | Ruby | mit | 191 | main | 375 | describe 'List Team' do
it 'should list all team nodes' do
create(:assignment)
create(:assignment_node)
assignment_team = create(:assignment_team)
create(:team_user)
login_as('instructor6')
visit '/teams/list?id=1&type=Assignment'
page.all('#theTable tr').each do |tr|
expect(tr).to... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_topics_spec.rb | Ruby | mit | 191 | main | 4,706 | require_relative 'helpers/assignment_creation_helper'
describe 'Assignment creation topics tab', js: true do
include AssignmentCreationHelper
before(:each) do
create_deadline_types
(1..3).each do |i|
create(:course, name: "Course #{i}")
end
assignment = create(:assignment, name: 'public assig... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/inherit_teams_display_spec.rb | Ruby | mit | 191 | main | 1,099 | describe 'displaying inherit teams section' do
it 'should display inherit teams option while creating an assignment team' do
create(:assignment)
create(:assignment_node)
create(:assignment_team)
login_as('instructor6')
visit '/teams/list?id=1&type=Assignment'
click_link 'Create Team'
expe... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_creation_dates_spec.rb | Ruby | mit | 191 | main | 2,117 | require_relative 'helpers/assignment_creation_helper'
include AssignmentCreationHelper
describe 'assignment creation due dates', js: true do
before(:each) do
create_deadline_types
@assignment = create(:assignment, name: 'public assignment for test')
login_as('instructor6')
visit "/assignments/#{@assi... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/teams_as_reviewers_spec.rb | Ruby | mit | 191 | main | 2,695 | describe 'teams as reviewers' do
before(:each) do
@assignment = create(:assignment, name: 'automatic review mapping test', max_team_size: 4, team_reviewing_enabled: true)
create(:assignment_node)
create(:deadline_type, name: 'submission')
review_type = create(:deadline_type, name: 'review')
create... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/calibration_spec.rb | Ruby | mit | 191 | main | 1,928 | describe 'calibration' do
###
# Please follow the TDD process as much as you can.
# Use factories to create necessary DB records.
# Please avoid duplicated code as much as you can by moving the code to before(:each) block or separated methods.
# RSpec feature tests examples: spec/features/airbrake_exception_e... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/bookmark_review_spec.rb | Ruby | mit | 191 | main | 3,129 | describe 'bookmark review testing' do
let(:bookmark_rating_response_map) { build(:review_response_map, type: 'BookmarkRatingResponseMap') }
before(:each) do
create(:assignment, name: 'TestAssignment', directory_path: 'test_assignment', use_bookmark: true)
create_list(:participant, 3)
create(:assignment_... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/quiz_spec.rb | Ruby | mit | 191 | main | 18,616 | include InstructorInterfaceHelperSpec
def create_assignment_due_date
set_deadline_type
set_deadline_right
create :assignment_due_date, due_at: (DateTime.now.in_time_zone + 1.day)
@review_deadline_type = create(:deadline_type, name: 'review')
create :assignment_due_date, due_at: (DateTime.now.in_time_zone + 1... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/assignment_team_member_spec.rb | Ruby | mit | 191 | main | 787 | describe 'add assignment team member test' do
before(:each) do
create(:assignment)
create_list(:participant, 3)
create(:assignment_node)
create(:assignment_team)
create(:assignment_team_node)
end
describe '#add_participant' do
# to test adding a assignment participant to an assignment tea... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/helpers/instructor_interface_helper.rb | Ruby | mit | 191 | main | 1,680 | module InstructorInterfaceHelperSpec
def set_deadline_type
create(:deadline_type, name: 'submission')
create(:deadline_type, name: 'review')
create(:deadline_type, name: 'metareview')
create(:deadline_type, name: 'drop_topic')
create(:deadline_type, name: 'signup')
create(:deadline_type, name:... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/helpers/assignment_creation_helper.rb | Ruby | mit | 191 | main | 1,842 | module AssignmentCreationHelper
def get_questionnaire(finder_var = nil)
if finder_var.nil?
AssignmentQuestionnaire.find_by(assignment_id: @assignment.id)
else
AssignmentQuestionnaire.where(assignment_id: @assignment.id).where(questionnaire_id: get_selected_id(finder_var))
end
end
def get_... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/features/bookmarks/sign_up_sheet_spec.rb | Ruby | mit | 191 | main | 1,178 | describe 'sign_up_sheet/list.html.erb' do
def create_assignment_bookmarks
create(:assignment, name: 'TestAssignment', directory_path: 'TestAssignment', use_bookmark: true)
create_list(:participant, 3)
create(:topic)
create(:bookmark)
end
def create_assignment_no_bookmarks
create(:assignment, ... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/factories/factories.rb | Ruby | mit | 191 | main | 21,501 | FactoryBot.define do
factory :institution, class: Institution do
name 'North Carolina State University'
end
factory :markup_style, class: MarkupStyle do
name 'Duy Test'
end
factory :lock, class: Lock do
lockable_id 123
lockable_type 'Duy lockable test'
user_id 1234
end
factory :re... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/factories/quiz_factory.rb | Ruby | mit | 191 | main | 3,625 | # This file defines factory methods that are functionally related
# to the Expertiza quiz feature. Factories can be used to create
# objects unique to quizzes, including:
# QuizQuestionnaire
# QuizQuestion
# QuizQuestionChoice
# QuizResponseMap
# QuizResponse
# Answer
#
# Note that many of these classes are... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/services/mcp_review_service_spec.rb | Ruby | mit | 191 | main | 1,028 | require 'rails_helper'
describe MCPReviewService do
describe '#send_peer_review' do
it 'sends only the latest submitted response ids selected for the assignment' do
mcp_client = instance_double(MCPServerClient)
service = described_class.new(mcp_client: mcp_client)
assignment_id = 101
firs... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/reputation_web_server_hamer.rb | Ruby | mit | 191 | main | 1,677 | require "net/http"
require "json"
INPUTS = {
"submission9999": {
"stu9999": 10,
"stu9998": 10,
"stu9997": 9,
"stu9996": 5
},
"submission9998": {
"stu9999": 3,
"stu9998": 2,
"stu9997": 4,
"stu9996": 5
},
"submission9997": {
"stu9999": 7,
"stu9998": 4,
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/institution_controller_spec.rb | Ruby | mit | 191 | main | 5,006 | require 'rails_helper'
describe InstitutionController do
let(:admin) { build(:admin) }
let(:instructor) { build(:instructor, id: 6) }
let(:instructor2) { build(:instructor, id: 66) }
let(:ta) { build(:teaching_assistant, id: 8) }
let(:student) { build(:student) }
# create fake data
let(:institution) do
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/reputation_mock_web_server_hamer.rb | Ruby | mit | 191 | main | 1,355 | require "net/http"
require "json"
INPUTS = {
"submission9999": {
"stu9999": 10,
"stu9998": 10,
"stu9997": 9,
"stu9996": 5
},
"submission9998": {
"stu9999": 3,
"stu9998": 2,
"stu9997": 4,
"stu9996": 5
},
"submission9997": {
"stu9999": 7,
"stu9998": 4,
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/late_policies_controller_spec.rb | Ruby | mit | 191 | main | 7,778 | describe LatePoliciesController do
let(:instructor) { build(:instructor, id: 6) }
before(:each) do
stub_current_user(instructor, instructor.role.name, instructor.role)
end
describe 'GET #index' do
context 'when index is called' do
it 'routes to index page' do
get :index
expect(ge... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/lti_controller_spec.rb | Ruby | mit | 191 | main | 7,361 | # spec/controllers/lti_controller_spec.rb
require 'rails_helper'
ENV['EXPERTIZA_BASE_URL'] = 'https://expertiza.ncsu.edu/'
RSpec.describe LtiController, type: :controller do
let(:valid_lti_params) do
{
'lis_person_contact_email_primary' => 'testuser@ncsu.edu',
'other_param' => 'value'
}
end
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/versions_controller_spec.rb | Ruby | mit | 191 | main | 2,181 | describe VersionsController do
let(:admin) { build(:admin, id: 3) }
let(:instructor) { build(:instructor, id: 2) }
let(:student) { build_stubbed(:student, id: 1, name: 'student') }
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:version) { build(:version) }
describe '#action_allowed?' do
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/reputation_web_service_controller_spec.rb | Ruby | mit | 191 | main | 11,568 | describe ReputationWebServiceController do
let(:instructor) { build(:instructor, id: 1) }
describe 'custom test' do
before(:each) do
@assignment_1 = create(:assignment, created_at: DateTime.now.in_time_zone - 13.day, submitter_count: 0, num_reviews: 3, num_reviewers: 3, num_reviews_allowed: 3, rounds_of_r... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/profile_controller_spec.rb | Ruby | mit | 191 | main | 4,113 | require 'rails_helper'
describe ProfileController do
# initialize objects using factories.rb required for stubbing in test cases
let(:super_admin) { build(:superadmin, id: 1) }
let(:instructor1) { build(:instructor, id: 10, name: 'Instructor1') }
let(:questionnaire) { build(:questionnaire, id: 666) }
let(:as... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/markup_styles_controller_spec.rb | Ruby | mit | 191 | main | 7,213 | require 'rails_helper'
describe MarkupStylesController do
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:student) { build(:student, id: 1, role_id: 1) }
let(:student_role) { build(:role_of_student, id: 1, name: 'Student_role_test', description: '', parent_id: nil, default_page_id: nil) }
... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/badges_controller_spec.rb | Ruby | mit | 191 | main | 6,783 | describe BadgesController do
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:admin) { build(:admin, id: 3) }
let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
let(:student1) { build(:student, id: 21, role_id: 1) }
let(:ta) { build(:teaching_assist... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/assessment360_controller_spec.rb | Ruby | mit | 191 | main | 21,616 | describe Assessment360Controller do
let(:instructor) { build(:instructor, id: 6) }
let(:student) { build(:student, id: 6) }
let(:ta) { build(:teaching_assistant, id: 6) }
let(:administrator) { build(:admin, id: 6) }
let(:superadmin) { build(:superadmin, id: 6) }
let(:course) { double('Course', instructor_id... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/lock_controller_spec.rb | Ruby | mit | 191 | main | 1,907 | describe LockController do
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
let(:student1) { build(:student, id: 21, role_id: 1) }
let(:lock1) { build(:lock, id: 1, user: instructor1, lockable_type: 'test ... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/invitations_controller_spec.rb | Ruby | mit | 191 | main | 6,457 | describe InvitationsController do
let(:instructor) { build(:instructor, id: 6) }
let(:student) { build(:student, parent_id: 2, id: 1) }
let(:student1) { build(:student, id: 2) }
let(:admin) { build(:admin) }
let(:ta) { build(:teaching_assistant, id: 8) }
let(:invitation) { build(:invitation) }
let(:partic... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/assignment_questionnaire_controller_spec.rb | Ruby | mit | 191 | main | 9,114 | describe AssignmentQuestionnaireController do
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
let(:student1) { build(:student, id: 21, role_id: 1) }
let(:assignment) { build(:assignment, id: 1) }
#Extr... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/submission_records_controller_spec.rb | Ruby | mit | 191 | main | 3,723 | describe SubmissionRecordsController do
# initialize objects using factories.rb required for stubbing in test cases
let(:super_admin) { build(:superadmin, id: 1) }
let(:instructor1) { build(:instructor, id: 10, name: 'Instructor1') }
let(:instructor2) { build(:instructor, id: 11, name: 'Instructor2') }
let(:t... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/join_team_request_controller_spec.rb | Ruby | mit | 191 | main | 7,171 | require './spec/support/teams_shared.rb'
describe JoinTeamRequestsController do
# Including the stubbed objects from the teams_shared.rb file
include_context 'object initializations'
# Including the shared method from the teams_shared.rb file
include_context 'authorization check'
# Testing action_allowed? co... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/publishing_controller_spec.rb | Ruby | mit | 191 | main | 8,719 | describe PublishingController do
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:admin) { build(:admin, id: 3) }
let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
let(:student1) { build(:student, id: 21, role_id: 1) }
let(:ta) { build(:teaching_as... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/teams_users_controller_spec.rb | Ruby | mit | 191 | main | 17,725 | require './spec/support/teams_shared.rb'
describe TeamsUsersController do
# Including the stubbed objects from the teams_shared.rb file
include_context 'object initializations'
# Objects initialization for team users
let(:teamUser) { build(:team_user, id: 1, team_id: 1, user_id: 1) }
let(:teamUser2) { build(... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/impersonate_controller_spec.rb | Ruby | mit | 191 | main | 16,148 | describe ImpersonateController do
let(:instructor) { build(:instructor, id: 2) }
let(:student1) { build(:student, id: 30, name: :Amanda) }
let(:student2) { build(:student, id: 40, name: :Brian) }
let(:admin) { build(:admin, id: 3, name: :Admin) }
let(:super_admin) { build(:superadmin, id: 5, name: :Superadmin... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/submitted_content_controller_spec.rb | Ruby | mit | 191 | main | 18,769 | describe SubmittedContentController do
let(:admin) { build(:admin, id: 3) }
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
let(:student1) { build(:student, id: 21, role_id: 1) }
let(:team) { build(:ass... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/application_controller_spec.rb | Ruby | mit | 191 | main | 446 | describe ApplicationController do
describe 'remove_non_utf8' do
it 'should not remove utf8 characters' do
controller.params[:key] = 'abc漢字123!@$'
controller.filter_utf8
expect(controller.params[:key]).to eql 'abc漢字123!@$'
end
it 'should remove non utf8 characters' do
controller.par... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/sign_up_sheet_controller_spec.rb | Ruby | mit | 191 | main | 43,070 | describe SignUpSheetController do
let(:assignment) { build(:assignment, id: 1, instructor_id: 6, due_dates: [due_date], microtask: true, staggered_deadline: true, directory_path: 'assignment') }
let(:assignment2) { create(:assignment, id: 2, microtask: false, staggered_deadline: false, private: true, directory_path... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/grades_controller_spec.rb | Ruby | mit | 191 | main | 18,237 | describe GradesController do
let(:review_response) { build(:response) }
let(:assignment) { build(:assignment, id: 1, max_team_size: 2, questionnaires: [review_questionnaire], is_penalty_calculated: true) }
let(:assignment2) { build(:assignment, id: 2, max_team_size: 2, questionnaires: [review_questionnaire], is_p... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/assignments_controller_spec.rb | Ruby | mit | 191 | main | 21,798 | describe AssignmentsController do
let(:assignment) do
build(:assignment, id: 1, name: 'test assignment', instructor_id: 6, staggered_deadline: true, directory_path: 'test_assignment',
participants: [build(:participant)], teams: [build(:assignment_team)], course_id: 1)
end
let(:assignmen... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/content_pages_controller_spec.rb | Ruby | mit | 191 | main | 3,693 | describe ContentPagesController do
let(:instructor) { build(:instructor, id: 6) }
let(:content_page_home) { build(:content_page, id: 1) }
let(:superadmin) { create(:superadmin) }
before(:each) do
stub_current_user(instructor, instructor.role.name, instructor.role)
@markup_style = MarkupStyle.new(name: ... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/auth_controller_spec.rb | Ruby | mit | 191 | main | 4,002 | describe AuthController do
let(:admin) { build(:admin) }
let(:instructor) { build(:instructor, id: 6) }
let(:instructor_role) { build(:role_of_instructor, id: 2, name: 'Instructor_role_test', description: '', parent_id: nil, default_page_id: nil) }
describe '#action_allowed?' do
before(:each) do
stub_... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/account_request_controller_spec.rb | Ruby | mit | 191 | main | 6,774 | describe AccountRequestController do
let(:admin) { build(:admin, id: 3) }
let(:super_admin) { build(:superadmin) }
let(:instructor) { build(:instructor, id: 2) }
let(:student1) { build(:student, id: 1, name: :lily) }
let(:student2) { build(:student) }
let(:student3) { build(:student, id: 10, role_id: 1, par... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/bookmarks_controller_spec.rb | Ruby | mit | 191 | main | 3,908 | describe BookmarksController do
# initialize any recurring objects
let(:bookmark) { build(:bookmark) }
let(:student) { build(:student, id: 1) }
let(:instructor) { build(:instructor, id: 2) }
let(:ta) { build(:teaching_assistant, id: 3) }
# for student
describe '#action_allowed?' do
context 'when para... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/questions_controller_spec.rb | Ruby | mit | 191 | main | 1,254 | describe QuestionsController do
let(:instructor) { build(:instructor, id: 6) }
let!(:questionnaire) { create(:questionnaire, id: 1) }
let!(:question) { create(:question, id: 1, questionnaire_id: 1) }
before(:each) do
stub_current_user(instructor, instructor.role.name, instructor.role)
end
describe '#de... |
github | expertiza/expertiza | https://github.com/expertiza/expertiza | spec/controllers/advice_controller_spec.rb | Ruby | mit | 191 | main | 9,186 | describe AdviceController do
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
let(:student1) { build(:student, id: 21, role_id: 1) }
describe '#action_allowed?' do
context 'when the role of current us... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.