Sha256: 1a758b963fc529697564e3e3807ac5964542e1559d43e4f4493fa2775a3e7b52

Contents?: true

Size: 1.46 KB

Versions: 51

Compression:

Stored size: 1.46 KB

Contents

require 'spec_helper'

feature 'Invitations Flow', organization_workspace: :test do
  let(:organization) { Organization.current }

  let(:guide) { create(:guide) }
  let(:chapter) {
    create(:chapter, lessons: [
      create(:lesson, guide: guide)
    ]) }
  let(:book) { organization.book }
 
  before do
    book.update! chapters: [chapter]
  end

  let(:permissions) { { } }
  let(:user) { create(:user, permissions: permissions) }
  before { set_current_user!(user) }

  let(:nodejs_course) { create(:course, slug: 'test/nodejs', name: 'Curso de NodeJS', organization: organization) }
  let(:python_course) { create(:course, slug: 'test/python', name: 'Curso de Python', organization: organization) }
  let!(:nodejs_invitation) { create(:invitation, code: 'invitacionAlNodejs', course: nodejs_course) }
  let!(:python_invitation) { create(:invitation, code: 'invitacionAlPython', course: python_course) }

  context 'with no memberships' do
    scenario 'visit invitation' do
      visit '/join/invitacionAlNodejs'
      expect(page).to have_text('Join Curso de NodeJS')
    end
  end

  context 'with existing memberships' do
    let(:permissions) { { student: 'test/nodejs' } }

    scenario 'visit invitation, already joined' do
      visit '/join/invitacionAlNodejs'
      expect(page).to have_text('Start Practicing!')
    end

    scenario 'visit invitation, not joined' do
      visit '/join/invitacionAlPython'
      expect(page).to have_text('Join Curso de Python')
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
mumuki-laboratory-7.10.5 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.10.4 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.10.3 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.10.2 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.10.1 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.10.0 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.9.2 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.9.1 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.9.0 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.7.6 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.7.5 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.7.4 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.8.0 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.7.3 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.7.2 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.7.1 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.7.0 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.6.2 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.6.1 spec/features/invitations_flow_spec.rb
mumuki-laboratory-7.6.0 spec/features/invitations_flow_spec.rb