Skip to content

Commit

Permalink
update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
betterzega committed Apr 28, 2017
1 parent 57b6415 commit df57691
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/models/test_track/session.rb
Expand Up @@ -122,7 +122,7 @@ def response_headers
end

def manage_response_headers!
response_headers[visitor_response_header_name] = visitor.id if visitor.id_changed?
response_headers[visitor_response_header_name] = visitor.id if visitor.id_overridden_by_existing_visitor?
end

def notify_unsynced_assignments!
Expand Down
6 changes: 3 additions & 3 deletions app/models/test_track/visitor.rb
Expand Up @@ -98,8 +98,8 @@ def loaded?
!offline? && @remote_visitor.present?
end

def id_changed?
@id_changed || false
def id_overridden_by_existing_visitor?
@id_overridden_by_existing_visitor || false
end

private
Expand All @@ -117,7 +117,7 @@ def remote_visitor
end

def merge!(other)
@id_changed = id != other.id
@id_overridden_by_existing_visitor = id != other.id
@id = other.id
@assignment_registry = assignment_registry.merge(other.assignment_registry)
@unsynced_assignments = nil
Expand Down
2 changes: 1 addition & 1 deletion spec/models/test_track/session_spec.rb
Expand Up @@ -73,7 +73,7 @@
subject.log_in!("identifier_type", "value")
end

expect(controller.response.headers['X-Set-TT-Visitor-ID']).to eq(nil)
expect(controller.response.headers).not_to have_key('X-Set-TT-Visitor-ID')
end
end

Expand Down

0 comments on commit df57691

Please sign in to comment.