|
5 | 5 | let(:book_uuid) { '62a49025-8cd8-407c-9cfb-c7eba55cf1c6' } |
6 | 6 | let(:fixture_path) { 'spec/fixtures/sample_import_assessments.xlsx' } |
7 | 7 |
|
8 | | - before(:all) do |
9 | | - DatabaseCleaner.start |
10 | | - |
11 | | - 2.times { FactoryBot.create :user, :agreed_to_terms } |
12 | | - end |
13 | | - after(:all) { DatabaseCleaner.clean } |
14 | | - |
15 | 8 | it 'imports exercises from the spreadsheet and adds Assignable tags' do |
16 | | - author = User.find(1) |
17 | | - copyright_holder = User.find(2) |
| 9 | + allow(User).to receive(:find) { FactoryBot.create :user, :agreed_to_terms } |
18 | 10 |
|
19 | 11 | allow_any_instance_of(OpenStax::Content::Book).to receive(:version).and_return('964da1b') |
20 | 12 |
|
|
35 | 27 | [stem_answer.answer.content, stem_answer.correctness.to_s, stem_answer.feedback] |
36 | 28 | end)).to eq Set[['Right', '1.0', 'This is why A is correct'], ['Wrong', '0.0', 'This is why B is wrong']] |
37 | 29 | expect(exercises[0].questions.first.collaborator_solutions.first.content).to eq 'Some solution' |
| 30 | + expect(exercises[0].publication.published_at?).to eq true |
38 | 31 |
|
39 | 32 | expect(Set.new exercises[1].tags.map(&:to_s)).to eq Set[ |
40 | 33 | 'assessment:practice:https://openstax.org/orn/book:page/62a49025-8cd8-407c-9cfb-c7eba55cf1c6:6c30d0cc-e435-4081-be68-5ff2f558cbec', |
|
47 | 40 | [stem_answer.answer.content, stem_answer.correctness.to_s, stem_answer.feedback] |
48 | 41 | end)).to eq Set[['Not this one', '0.0', 'Better luck next time'], ['This one', '1.0', 'Good job']] |
49 | 42 | expect(exercises[1].questions.first.collaborator_solutions.first.content).to eq 'Another solution' |
| 43 | + expect(exercises[1].publication.published_at?).to eq true |
50 | 44 | end |
51 | 45 | end |
0 commit comments