Advertisement
Guest User

Untitled

a guest
May 26th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. require 'spec_helper'
  2.  
  3. feature 'Teacher lists available course templates', type: :feature do
  4. include IntegrationTestActions
  5.  
  6. before :each do
  7. @organization = FactoryGirl.create :accepted_organization, slug: 'slug'
  8. @teacher = FactoryGirl.create :user, password: 'xooxer'
  9. @user = FactoryGirl.create :user, password: 'foobar'
  10. Teachership.create! user: @teacher, organization: @organization
  11.  
  12. FactoryGirl.create :course_template, title: 'template1'
  13. FactoryGirl.create :course_template, title: 'template2'
  14. FactoryGirl.create :course_template, title: 'template3'
  15.  
  16. visit '/'
  17. end
  18.  
  19. scenario 'Teacher suceeds at listing course templates' do
  20. u = User.find_by_login @teacher.login
  21. puts u.nil?
  22. log_in_as(@teacher.login, 'xooxer')
  23.  
  24. visit "/org/slug"
  25. click_link 'Create course from template'
  26. expect(page).to have_content('template1')
  27. expect(page).to have_content('template2')
  28. expect(page).to have_content('template3')
  29. end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement