Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- feature 'Teacher lists available course templates', type: :feature do
- include IntegrationTestActions
- before :each do
- @organization = FactoryGirl.create :accepted_organization, slug: 'slug'
- @teacher = FactoryGirl.create :user, password: 'xooxer'
- @user = FactoryGirl.create :user, password: 'foobar'
- Teachership.create! user: @teacher, organization: @organization
- FactoryGirl.create :course_template, title: 'template1'
- FactoryGirl.create :course_template, title: 'template2'
- FactoryGirl.create :course_template, title: 'template3'
- visit '/'
- end
- scenario 'Teacher suceeds at listing course templates' do
- u = User.find_by_login @teacher.login
- puts u.nil?
- log_in_as(@teacher.login, 'xooxer')
- visit "/org/slug"
- click_link 'Create course from template'
- expect(page).to have_content('template1')
- expect(page).to have_content('template2')
- expect(page).to have_content('template3')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement