-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RSpec for Supervisor Course View for destroy action 49775
- Loading branch information
Showing
5 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require "rails_helper" | ||
|
||
feature "Destroy course" do | ||
subject {page} | ||
let(:supervisor) {FactoryGirl.create :supervisor} | ||
let!(:course){FactoryGirl.create :course, user_ids: [supervisor.id]} | ||
before :each do | ||
course.finished! | ||
login_as supervisor, scope: :user | ||
visit supervisor_courses_path | ||
end | ||
|
||
scenario "has delete button" do | ||
Course.finished.each do |course| | ||
is_expected.to have_link(I18n.t("supervisor.courses.course.delete"), href: | ||
"/supervisor/courses/#{course.id}") | ||
end | ||
end | ||
|
||
scenario "destroy course feature", js: true do | ||
click_link(I18n.t("supervisor.courses.course.delete"), href: | ||
"/supervisor/courses/#{course.id}") | ||
sleep 3 | ||
page.driver.browser.switch_to.alert.accept | ||
is_expected.to have_text I18n.t "supervisor.courses.destroy.course_delete" | ||
end | ||
end |