spec fix spec for dates with single digit

test plan
 - spec should pass

Change-Id: I92c30d8f794298d8c96d68a4fe696f5c3a958528
Reviewed-on: https://gerrit.instructure.com/62090
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
This commit is contained in:
Rob Orton 2015-08-29 11:53:14 -06:00
parent 7949540c0e
commit a6ceb901ed
1 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ describe "discussions" do
user_session(@student1)
find_vdd_time(@assignment)
get "/courses/#{@course.id}/discussion_topics"
expect(f("#open-discussions .discussion-date-available").text).to include("Available until #{@lock_at_time[0, 6]}")
expect(f("#open-discussions .discussion-date-available").text).to include("Available until #{@lock_at_time[0, 6].strip}")
expect(f("#open-discussions .discussion-due-date").text).to include("Due #{@due_at_time}")
expect_new_page_load{f('#open-discussions .discussion-title').click}
expect(f('.discussion-reply-action')).to be_present
@ -40,7 +40,7 @@ describe "discussions" do
find_vdd_time(@override)
get "/courses/#{@course.id}/discussion_topics"
expect(f("#open-discussions .discussion-date-available").text).
to include("Not available until #{@unlock_at_time[0, 6]}")
to include("Not available until #{@unlock_at_time[0, 6].strip}")
expect(f("#open-discussions .discussion-due-date").text).to include("Due #{@due_at_time}")
expect_new_page_load{f('#open-discussions .discussion-title').click}
expect(f('.discussion-reply-action')).not_to be_present
@ -57,7 +57,7 @@ describe "discussions" do
# Find the due, available and lock dates of the assignment(everyone)
find_vdd_time(@assignment)
expect(f('.discussion-topic-due-dates')).to be_present
expect(f('.discussion-topic-due-dates tbody tr td:nth-of-type(1)').text).to include(@due_at_time[0, 6])
expect(f('.discussion-topic-due-dates tbody tr td:nth-of-type(1)').text).to include(@due_at_time[0, 6].strip)
expect(f('.discussion-topic-due-dates tbody tr td:nth-of-type(2)').text).to include('Everyone else')
expect(f('.discussion-topic-due-dates tbody tr td:nth-of-type(3)').text).to include(@unlock_at_time)
expect(f('.discussion-topic-due-dates tbody tr td:nth-of-type(4)').text).to include(@lock_at_time)
@ -65,7 +65,7 @@ describe "discussions" do
# Find the due, available and lock dates of the override(dates assigned to section)
find_vdd_time(@override)
expect(f('.discussion-topic-due-dates tbody tr:nth-of-type(2) td:nth-of-type(1)').text).
to include(@due_at_time[0, 6])
to include(@due_at_time[0, 6].strip)
expect(f('.discussion-topic-due-dates tbody tr:nth-of-type(2) td:nth-of-type(2)').text).to include('New Section')
expect(f('.discussion-topic-due-dates tbody tr:nth-of-type(2) td:nth-of-type(3)').text).
to include(@unlock_at_time)