<commit_before>require 'rails_helper'

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_type, name: "review")
    create(:deadline_type, name: "metareview")
    create(:deadline_type, name: "drop_topic")
    create(:deadline_type, name: "signup")
    create(:deadline_type, name: "team_formation")
    create(:deadline_right)
    create(:deadline_right, name: 'Late')
    create(:deadline_right, name: 'OK')
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: "submission").first, due_at: DateTime.now + 1)
  end

  def signup_topic
    user = User.find_by_name("student2064")
    stub_current_user(user, user.role.name, user.role)
    visit '/student_task/list'
    visit '/sign_up_sheet/sign_up?id=1&topic_id=1' #signup topic
    visit '/student_task/list'
    click_link "Assignment1684"
    click_link "Your work"
  end

  it "test1: submit single link" do
    signup_topic
    fill_in 'submission', with: "https://google.com"
    click_on 'Upload link'
    expect(page).to have_content "https://google.com"
  end
end
<commit_msg>test upload multiple link<commit_after>require 'rails_helper'

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_type, name: "review")
    create(:deadline_type, name: "metareview")
    create(:deadline_type, name: "drop_topic")
    create(:deadline_type, name: "signup")
    create(:deadline_type, name: "team_formation")
    create(:deadline_right)
    create(:deadline_right, name: 'Late')
    create(:deadline_right, name: 'OK')
    create(:assignment_due_date, deadline_type: DeadlineType.where(name: "submission").first, due_at: DateTime.now + 1)
  end

  def signup_topic
    user = User.find_by_name("student2064")
    stub_current_user(user, user.role.name, user.role)
    visit '/student_task/list'
    visit '/sign_up_sheet/sign_up?id=1&topic_id=1' #signup topic
    visit '/student_task/list'
    click_link "Assignment1684"
    click_link "Your work"
  end

  it "test1: submit single link" do
    signup_topic
    fill_in 'submission', with: "https://google.com"
    click_on 'Upload link'
    expect(page).to have_content "https://google.com"
  end

  it "test2: submit multiple link" do
    signup_topic
    fill_in 'submission', with: "https://google.com"
    click_on 'Upload link'
    fill_in 'submission', with: "https://baidu.com"
    click_on 'Upload link'
    fill_in 'submission', with: "https://bing.com"
    click_on 'Upload link'
    expect(page).to have_content "https://google.com"
    expect(page).to have_content "https://baidu.com"
    expect(page).to have_content "https://bing.com"
  end
end

{'fraction_non_alphanumeric': 0.1277278562259307, 'fraction_numerical': 0.0137997432605905, 'mean_word_length': 4.430313588850174, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3006912', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1048, 'n_words': 233}