Merge pull request #365 from AyuntamientoMadrid/flags_for_turbolinks
Flags for turbolinks
This commit is contained in:
@@ -30,12 +30,11 @@ var initialize_modules = function() {
|
||||
App.Votes.initialize();
|
||||
App.Tags.initialize();
|
||||
App.Stats.initialize();
|
||||
App.Dropdown.initialize();
|
||||
App.LocationChanger.initialize();
|
||||
};
|
||||
|
||||
$(function(){
|
||||
$(document).foundation();
|
||||
|
||||
$(document).ready(initialize_modules);
|
||||
$(document).on('page:load', initialize_modules);
|
||||
$(document).on('ajax:complete', initialize_modules);
|
||||
|
||||
4
app/assets/javascripts/dropdown.js.coffee
Normal file
4
app/assets/javascripts/dropdown.js.coffee
Normal file
@@ -0,0 +1,4 @@
|
||||
App.Dropdown =
|
||||
|
||||
initialize: ->
|
||||
$(document).foundation();
|
||||
@@ -169,6 +169,21 @@ feature 'Comments' do
|
||||
expect(Flag.flagged?(user, comment)).to_not be
|
||||
end
|
||||
|
||||
scenario "Flagging turbolinks sanity check", :js do
|
||||
user = create(:user)
|
||||
debate = create(:debate, title: "Should we change the world?")
|
||||
comment = create(:comment, commentable: debate)
|
||||
|
||||
login_as(user)
|
||||
visit debates_path
|
||||
click_link "Should we change the world?"
|
||||
|
||||
within "#comment_#{comment.id}" do
|
||||
page.find("#flag-expand-comment-#{comment.id}").click
|
||||
expect(page).to have_selector("#flag-comment-#{comment.id}")
|
||||
end
|
||||
end
|
||||
|
||||
feature "Moderators" do
|
||||
scenario "can create comment as a moderator", :js do
|
||||
moderator = create(:moderator)
|
||||
|
||||
Reference in New Issue
Block a user