Skip to content

Commit

Permalink
Updating post_comment test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaschabariberi committed Dec 4, 2019
1 parent 1c29f18 commit aca43c9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/app/features/post_comment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ I want to post a comment
So that I can tell what I think about any spotted

Background:
Given There is a college page created
Given There is a spotted created
And I logged in successfully
And I accessed a college page successfully
And I posted a spotted successfully on the college page

Scenario: student write a comment on the content field and clicks the button "Mandar Comentário"
Given I click the Ver spotted button
When I fill the content comment field with some information
Given I am on the college page
When I click the Ver spotted button
And I fill the content comment field with some information
And I click the Mandar comentário button icon
Then I should see the view spotted page
And I should see my new comment on the timeline
2 changes: 1 addition & 1 deletion src/app/features/receive_notification.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ I want to receive notifications from spotted
So that I can follow spotted updates

Background: There is a spotted and a comment created
Given There is a comment
Given There is a comment created
And I logged in successfully

Scenario: Student clicks on bell button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@
When I click on my college page link
Then I should see my college page
}
end

Given /^I am on the college page$/ do
visit college_spotteds_path(@college.id)
end
6 changes: 3 additions & 3 deletions src/app/features/step_definitions/post_comment_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
end

Then(/^I should see the view spotted page$/) do
expect(page).to have_xpath('.//h2', text: "Spotted n. 1")
expect(page).to have_xpath('.//h2', text: "Spotted n.")
end

And(/^I should see my new comment on the timeline$/) do
Expand All @@ -33,9 +33,9 @@

end

Given (/^There is a comment$/) do
Given (/^There is a comment created$/) do
steps %Q{
Given There is a spotted
Given There is a spotted created
}

u = Comment.new(:content => "Comment Test", :user_id => @user.id, :spotted_id => @spotted.id)
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/step_definitions/post_spotted_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@spotted = Spotted.find_by(content: "Spotted")
end

Given (/^There is a spotted$/) do
Given (/^There is a spotted created$/) do
steps %Q{
Given There is a college page created
}
Expand Down

0 comments on commit aca43c9

Please sign in to comment.