diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 89a657a37..2184e7588 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -26,6 +26,8 @@ class ProfilesController < ApplicationController munge_tag_string + #checkbox tags wtf + @profile_attrs[:nsfw] ||= false @profile_attrs[:searchable] ||= false if params[:photo_id] diff --git a/features/not_safe_for_work.feature b/features/not_safe_for_work.feature index ee8520c08..8bf261236 100644 --- a/features/not_safe_for_work.feature +++ b/features/not_safe_for_work.feature @@ -18,6 +18,14 @@ Scenario: NSFWs users posts are nsfw And I post "I love 0bj3ction4bl3 c0nt3nt!" Then the post "I love 0bj3ction4bl3 c0nt3nt!" should be marked nsfw +Scenario: Making yourself SFW + Given a nsfw user with email "tommy@pr0nking.com" + And I sign in as "tommy@pr0nking.com" + And I go to the edit profile page + When I mark myself as safe for work + And I submit the form + Then I should see the "you are safe for work" message + # And I log out # And I log in as an office worker # And I am folllowing "tommy@pr0n.xxx" diff --git a/features/step_definitions/profile_steps.rb b/features/step_definitions/profile_steps.rb index 162364f2d..1c9c6a4b9 100644 --- a/features/step_definitions/profile_steps.rb +++ b/features/step_definitions/profile_steps.rb @@ -1,3 +1,7 @@ And /^I mark myself as not safe for work$/ do check('profile[nsfw]') end + +And /^I mark myself as safe for work$/ do + uncheck('profile[nsfw]') +end